Frogi
Newbie level 2
Hello , I'm new to matlab , and I wanna solve an assignment
the question is to generate 4 windows and compute their power spectral, then generate a 4-by-2 plot where the 1st column has windows plots in time domain and the other column for frequency domain ,
i wrote this code but i have few problems, I hope you can help, thanks in advance
%---------window generation
M=128;
n=[0:M-1];
bartlett=1-(abs(2*n-M-1)/(M-1));
blackman=0.42-0.5*cos(2*n*pi/(M-1))+0.8*cos(4*n*pi/(M-1));
hamming=0.54-0.46*cos(2*n*pi/(M-1));
hanning=0.5-0.5*cos(2*n*pi/(M-1));
NFFT=512;
%--------------FFT
bartFFT=fft(bartlett,NFFT);
blacFFT=fft(blackman,NFFT);
hammFFT=fft(hamming,NFFT);
hanniFFT=fft(hanning,NFFT);
the question is to generate 4 windows and compute their power spectral, then generate a 4-by-2 plot where the 1st column has windows plots in time domain and the other column for frequency domain ,
i wrote this code but i have few problems, I hope you can help, thanks in advance
%---------window generation
M=128;
n=[0:M-1];
bartlett=1-(abs(2*n-M-1)/(M-1));
blackman=0.42-0.5*cos(2*n*pi/(M-1))+0.8*cos(4*n*pi/(M-1));
hamming=0.54-0.46*cos(2*n*pi/(M-1));
hanning=0.5-0.5*cos(2*n*pi/(M-1));
NFFT=512;
%--------------FFT
bartFFT=fft(bartlett,NFFT);
blacFFT=fft(blackman,NFFT);
hammFFT=fft(hamming,NFFT);
hanniFFT=fft(hanning,NFFT);