how to make a smooth sepectrum??

29 ビュー (過去 30 日間)
Ali nouri
Ali nouri 2020 年 6 月 28 日
回答済み: Ameer Hamza 2020 年 6 月 29 日
Hi guys,
I have been using the below code to make a loglog fft plot.
But i want to make a smooth spectrum, which goes through the fft plot??
I have also uploade a picture, which shows a fft plot with smooth spectrum.
Thanks in advance!
Fs = 1; % sample frequency (Hz)
N = length(A1); % number of samples
y = fft(A1);
f = (0:N-1)/Fs; % frequency range
power = abs(y).^2/N; % power of the DFT
figure(5)
bin_vals = [0 : N-1];
fax_Hz = bin_vals*Fs/N;
N_2 = ceil(N/2);
loglog(fax_Hz(1:N_2),(X_mags(1:N_2)))

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 6 月 29 日
See smoothdata(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/smoothdata.html. Pass the X_mags vector through smooth data to get a smooth profile. Similarly, you can also try low to use a low-pass filter: https://www.mathworks.com/help/signal/ref/lowpass.html on the fft data.

カテゴリ

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