7, 8 & 9 »Create a sinusoidal sequence of period 12 samples . Then create Wn matrix of 12 rowsand 12 columns . Multiply the sequence by Wn matrix to obtain the frequency spectrum of thesequence . Plot magnitude and phase part of the spectrum .
Code:
% Plotting a Sinusoidal sequence(x7) of period 12 samplesn=1:12;x7=cos(2*pi/5*n);subplot(3,1,1);stem(n,x7,'k','filled');title('Sinusoidal Sequence of Period 12 samples');% Creating Wn matrix of 12 rows and 12 columnsj=0:11;k=0;while k<=11Wn(j+1,k+1)=exp(-i*2*pi/12*j*k);k=k+1;end% Multiplying x7 by Wn to obtain the frequency spectrum of x7X=x7*Wn;% Plotting magnitude and Phase part of the spectrumsubplot(3,1,2);plot(abs(X),'k');title('Magnitude Response');xlabel('Samples');ylabel('Magnitude');subplot(3,1,3);plot(angle(X),'k');title('Phase Response');xlabel('Samples');ylabel('Angle');
Figur
e:
Leave a Comment