Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

A simple question about windows PSD, FFT in matlab

Status
Not open for further replies.

Frogi

Newbie level 2
Joined
May 4, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Jordan
Activity points
1,299
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);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top