You identify the peak in the Fourier transform, find the index in DFT vector corresponding to that peak and relate that to frequency.
For example:
Fs = 1000;
t = 0:0.001:1-0.001;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft(1:length(x)/2+1);
[Y,I] = max(abs(xdft));
freq = 0:Fs/length(x):Fs/2;
fprintf('Maximum occurs at %3.2f Hz\n.',freq(I))
Note that the frequency bins in the DFT are spaced at Fs/N where Fs is the sampling frequency and N is the length of the signal. The first DFT "bin" corresponds to zero frequency.
Your next step is to construct a bandpass filter around 1 kHz, you can do that a number of ways in MATLAB. See fdesign.bandpass for example.
Best Answer