sgolayfilt function not smoothing

조회 수: 10 (최근 30일)
Barny Cutter
Barny Cutter 2019년 4월 22일
댓글: Shrey Joshi 2019년 9월 20일
In the below code I am attempting to plot an audio file in the frequency domain using FFT, and then smooth out the frequency response with sgolayfilt, however the filter is not working. As a beginner, I'm not sure where to go next and would appreciate any help!
[y,Fs] = audioread('Floor_EQ_ITB.wav');
Fn = Fs/2; % Nyquist Frequency
fty = fft(y)/length(y); % Take FFT & Normalise
fv = linspace(0, 1, fix(length(fty)/2)+1)*Fn; % Frequency Vector For Plot
iv = 1:length(fv); % Index Vector For Plot
filt = sgolayfilt(fv, 5, 501);
figure(1)
semilogx(filt, 20*log10(abs(fty(iv))))
xlabel('Frequency (Hz)')
ylabel('Amplitude (dB)')
set(gca,'XLim',[15 20000],'XTick',[0 31 62 125 250 500 1000 2000 4000 8000 16000])
  댓글 수: 3
Barny Cutter
Barny Cutter 2019년 4월 22일
Too large to attach but available here
Shrey Joshi
Shrey Joshi 2019년 9월 20일
Try using signalAnalyzer app in signal processing toolbox.You can preprocess signal using sgolayfilt and visualize its spectrum

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by