フィルターのクリア

how to scale fft?

15 ビュー (過去 30 日間)
Rabih Sokhen
Rabih Sokhen 2022 年 2 月 10 日
コメント済み: Rabih Sokhen 2022 年 3 月 3 日
hy guys.
i have a question concerning the scaling in fft .
i have seen alot of code on this forum, but some of the code scale the fft with length of the time domain while other's with increment.
code:
clear all; clc
dt=0.1;
t=-5:dt:5;
z=numel(t);
df = 1/dt;
f = linspace(-df/2, df/2, z);
h_t=rectpuls(t,1/f0);
h_f=fftshift(fft(h_t,n));
% how to scale h_f? should i divide h_f with z or dt and why?
% thank you in advance

採用された回答

Matt J
Matt J 2022 年 2 月 10 日
編集済み: Matt J 2022 年 2 月 10 日
The DFT is a tool for computing several other theoretical transforms. It can be used to compute a Discrete Fourier Series, which is when you would scale by the length. It can also be used to approximate a continuous Fourier transform, which is when you scale by the time increment.
There is also some disagreement across different professions (esp., engineering versus physics) on scaling factors in the definitions of these transforms. Therefore, the safest way to determine the scaling that you need is to just compare the formula in Matlab's FFT defintiion to the formula for the thing you want to compute.
  8 件のコメント
Matt J
Matt J 2022 年 2 月 11 日
No, you must always multiply by dt. The issue of choosing how much zero-padding you need to do is separate.
Rabih Sokhen
Rabih Sokhen 2022 年 3 月 3 日
thank you Matt, sry for the late response .

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by