fft - Octave (Matlab): Spectrum calculation -


another question spectrum calculation in octave using fft:

with audacity created .wav file containing white noise, filtered lowpass fcut = 1khz, -20db/decade. spectrum analysed audacity looks expected (unfortunately can't post image since don't have enough reputation)

then analysed spectrum octave using following code:

  pkg load signal   %load signal package   graphics_toolkit ("gnuplot")  % use gnuplots    close   clear    [stereosig, fs,bit] =wavread('noise_stereo.wav'); % load wav   ch1 = stereosig(:,1); % left   ch2 = stereosig(:,2); % right    nfft = 1024;   nfft_half = nfft/2;   x = fft(ch1, nfft);   freqvect = (1:nfft_half+1)./nfft*fs;    figure(1)   x_mag_scaled = abs(x(1:nfft_half+1)./nfft_half);   semilogx(freqvect, 20*log10(x_mag_scaled));   grid on   xlabel('frequency (hz)')   ylabel('mag [db]') 

the plot produced octave extremly "unsmooth", -20db/decade can not recognised since difference between 2 adjacent points can > 10db or so. 1khz cut off frequency can guessed.

does have idea how "smooth" spectrum done in audacity (which suppose reasonable solution)?

philippe


Comments

Popular posts from this blog

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -

apache - setting document root in antoher partition on ubuntu -

java - Updating to mongo 3.0 -