필터 지우기
필터 지우기

Choosing FFT points

조회 수: 8 (최근 30일)
joeDiHare
joeDiHare 2011년 10월 28일
Hi All. It is not clear to me how to choose points in a FFT, and matlab Help, doesn't help on this. E.g., I have an L long array and I want an fft window of 32ms (which is 704 samples with a fs of 22kHz); fft(X(1:704)) gives me 704 frequency bins by default, but I want only a subset of frequency "lines", and specifically I need M=128 frequency bins. I tought I would just use the syntax fft(x(1:704),128), however:
x1=ifft( fft( x(1:704),128 ), 704)
is not equal to
x1=ifft( fft( x(1:704) ) )
Why?? (thanks)
  댓글 수: 1
Wayne King
Wayne King 2011년 10월 28일
By the way:
x1=ifft( fft( x(1:704),128 ), 704)
does not take the DFT of x(1:704) as you think, it takes the DFT of x(1:128)
isequal(fft(x(1:128)),fft(x(1:704),128))

댓글을 달려면 로그인하십시오.

채택된 답변

Wayne King
Wayne King 2011년 10월 28일
The bins in the DFT are Fs/N where N is the length of the input vector and Fs is the sampling frequency.
If you only want to evaluate the DFT at a subset of 128 DFT bins, then you can select those from the output of fft()
Also, see the help for goertzel(), which evaluates the DFT at specific bins.
  댓글 수: 1
joeDiHare
joeDiHare 2011년 10월 29일
Thanks for your answer.
Goertzel algorithm looks very good, but there is no IDFT.
Is it correct to use ifft(X), where X is the output of the goertzel "zeropadded" in the frequency bins discarded by the DFT, so that I have back a time domain signal 704 samples long?.
something like this:
ind_freq=1:2:128*2;
G=goertzel(x(1:704),ind_freq);
magn=abs(G); phas=phase(G);
X=zeros(704,2);
X(ind_freq,:)=[magn phas];
x=ifft( X(:,1).*exp(1j*X(:,2) )

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by