Hamming window for filtering unwanted terms
Below is some code (in scilab which is similar to but not the same as matlab) that attempts to do what you're saying.

The output is the following graph which has:


The original signal
The signal multiplied by the window to leave just the left-hand peak.
The signal modulated with a complex exponential to shift the remaining peak to the centre (DC).




// 25709
N = 1024;
dc = 1 + rand(1,N,'norm');
fc = 0.388729874;
a = 1+0.5*rand(1,N,'norm');
t = [0:N-1];
phi = 0.187238947;
x = dc + a.*sin(2*%pi*fc*t + phi);
X= fft(x);

f = fftshift((fftshift([0:N-1]) - N/2)/N);

clf;
subplot(311);
plot(f, fftshift(abs(X)))

subplot(312);
wind = [zeros(1,N-500) ones(1,500) ];
plot(f,fftshift(abs(X.*wind)));

subplot(313);
y = ifft(X.*wind);
yy = y.*exp(%i*2*%pi*fc*t);
plot(f,fftshift(abs(fft(yy))))