Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

separating a part of plot from an original fft plot

1 view (last 30 days)
777
777 on 9 Mar 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
i have a fft plot of an audio file over the range 0 to 3000hz. now i want to separate the 1000 to 2000 hz part of the plot into a diff variable. how to do that...?????
thanks in advance

Answers (1)

Tom
Tom on 9 Mar 2012
you can use the greater than/ less than symbols to do this: say your frequency data is stored as X, and your FFT data is stored as Y.
Z=Y(X>=1000 & X<=2000)
  2 Comments
777
777 on 9 Mar 2012
i had that in mind but the problem here is that fft is stored in a variable which is i dont think a function of frequency.
Dr. Seis
Dr. Seis on 9 Mar 2012
If the the number of data points (N) is even, then:
Fs = 6000;
Nyquist = Fs/2; % i.e., 3000 Hz
df = Fs/N;
X = ifftshift(-Nyquist:df:Nyquist-df);
if N is odd:
X = [(0:df:Nyquist) -1*sort(df:df:Nyquist,'descend')]

This question is closed.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!