matlab - How can i plot Fourier transform of a wav without using FFT -


how can plot fourier transformation of wav sound without using fft?
take rectangle windows size 256 on whole signal.

following code:

my code:

[wave,fs]=wavread('.\sound clip 32.wav');  sound(wave,fs);   t=1:1/fs:length(wave)-1/fs;  plot(t,wave);  n=length(wave)-1;   l=1:n,      x(l)=0; end  i=1:n,      h=1:256,         x(i)=x(i)+wave(h)*(exp(-(j*2*pi*i*h)/n));      end end  f=1:fs/n:n;  wavefft=abs(x);   plot(f,wavefft); 

but error

error:

??? error using ==> plot
vectors must same lengths.

error in ==> alirezabahrami @ 8 plot(t,wave);

how can resolve problem?

the first plot error caused t , wave being different lengths. truncate longest of 2 , plot, in case, t linearly increasing vector, can write

plot (wave) 

and display same thing, ie., audio wave. if write plot(t) diagonal line.

further down have exact same problem, write:

plot(wavefft) 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -