How to calculate only several frequency with FFT ?

4 visualizaciones (últimos 30 días)
xd
xd el 17 de En. de 2025
Editada: Paul el 22 de En. de 2025
Almost all cases, 1st, use FFT2 transfer to frequency field all , then to analysis like filter.
If I know only some frequecy are need,
Is it possible to calculate only several frequency not all frequencies with FFT ?
If OK, How to do?
for example, if ther are 512 data points, then will get 512 data points at frequency field, but I only need 0~50Hz,
How to tall FFT no need to calculated those data more than 50Hz ?
Like sparse , but source data are not sparse, the transfer target at freq domain is sparse .

Respuesta aceptada

Mathieu NOE
Mathieu NOE el 17 de En. de 2025
Movida: Matt J el 17 de En. de 2025

Más respuestas (1)

Paul
Paul el 17 de En. de 2025
If the desired frequenices are a subset of those that correspond to the DFT as computed by fft, I'd imagine in many cases there won't be a noticeable problem to call fft and then extract the desired subset of the results.
If the desired frequencies are not a subset of the DFT frequencies (or even if they are), then use freqz.
  2 comentarios
xd
xd el 22 de En. de 2025
Editada: xd el 22 de En. de 2025
freqz is for special filter, not for calculate any a few freq.
I don't know is it possible for gereral calculation ...
Paul
Paul el 22 de En. de 2025
Editada: Paul el 22 de En. de 2025
freqz can be used to compute arbitrary samples of the DTFT of any finite duration signal. The DFT samples are at specific frequencies of the DTFT.
To demonstrate, use freqz to compute the DTFT of x and show the DFT are samples of that.
rng(100);
x = randn(1,100);
Ts = 0.01;
xdft = fft(x);
wdft = (0:99)/100/Ts;
[h,w] = freqz(x,1,8192,'whole',1/Ts);
figure
plot(subplot(211),w,abs(h));
hold on
stem(wdft,abs(xdft))
plot(subplot(212),w,angle(h));
hold on
stem(wdft,angle(xdft))
The third argument to freqz can be used instead to specify specific frequencies of interest.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by