Spectrum Analysis using FFT and Hanning Window
2 ビュー (過去 30 日間)
古いコメントを表示
I need to conduct spectrum analysis on a pre-recorded audio file (.wav), using FFT and a Hanning window (size: 1024).
I am using the MIRtoolbox, DSP System Toolbox and Signal Processing Toolbox.
I've tried to do this using the below code, but keep getting errors.
MATLAB code
>> a1 = miraudio('Canjo.wav','Extract',8,15);
Computing miraudio related to Canjo.wav...
Computing mirsum related to Canjo.wav...
Elapsed time is 0.078341 seconds.
>> L = 1024;
>> w = hann(L);
>> mirspectrum(a1,'Window',w)
Here are the error messages.
MATLAB code
Operands to the || and && operators must be convertible to logical scalar values.
Error in miroptions (line 284)
if length(varg) > i && ...
Error in mirfunction (line 40)
[orig during after] = miroptions(method,orig,specif,varg);
Error in mirspectrum (line 294)
varargout = mirfunction(@mirspectrum,orig,varargin,nargout,specif,@init,@main);
Any help would be very appreciated, thanks!
0 件のコメント
回答 (1 件)
Santhana Raj
2017 年 3 月 17 日
Check the Syntax of the miraudio command.
As far as I can see, when you use 'Extract' option, you have to provide t1,t2,u,f. Out of which f is optional. I see that you have not mentioned u (unit of t1 & t2), which can take the value of 's' or 'sp'.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!