Matlab+lab+3+codes+and+plots

# Matlab+lab+3+codes+and+plots - x=filter(b,a[1 zeros(1,20...

This preview shows pages 1–4. Sign up to view the full content.

Matlab lab 3 codes and plots Part2: 1. % 9 point running average filter w=-pi:pi/100:pi; b=1/9*ones(1,9); a=1; [H F]=freqz(b,a,w); subplot(2,1,1),plot(w,abs(H)); set(gca, 'FontSize' ,12, 'fontname' , 'Times New Roman' , 'XColor' , 'k' , 'YColor' , 'k' ); h_legend=legend( 'Magnitude Response' ); set(h_legend, 'fontsize' ,10, 'fontname' , 'Times New Roman' ); xlabel( 'Normalized frequency' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); ylabel( 'Magnitude ' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); subplot(2,1,2),plot(w,angle(H)); set(gca, 'FontSize' ,12, 'fontname' , 'Times New Roman' , 'XColor' , 'k' , 'YColor' , 'k' ); h_legend=legend( 'phase Response' ); set(h_legend, 'fontsize' ,10, 'fontname' , 'Times New Roman' ); xlabel( 'Normalized frequency' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); ylabel( 'phase ' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); 2. % 9 point running average filter w=-pi:pi/100:pi; b=1/9*ones(1,9); a=1; [H F]=freqz(b,a,w);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x=filter(b,a,[1 zeros(1,20)]); n=0:20; stem(n,x); set(gca, 'FontSize' ,12, 'fontname' , 'Times New Roman' , 'XColor' , 'k' , 'YColor' , 'k' ); h_legend=legend( 'Impulse Response' ); set(h_legend, 'fontsize' ,10, 'fontname' , 'Times New Roman' ); xlabel( 'sample index' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); ylabel( 'Magnitude ' , 'fontsize' ,12, 'fontname' , 'Times New Roman' ); 3. % 9 point running average filter w=-pi:pi/100:pi; b=1/9*ones(1,9); y=roots(b) y = 0.7660 + 0.6428i 0.7660 - 0.6428i 0.1736 + 0.9848i 0.1736 - 0.9848i -0.9397 + 0.3420i -0.9397 - 0.3420i -0.5000 + 0.8660i -0.5000 - 0.8660i 4. % 9 point running average filter w=-pi:pi/100:pi; b=1/9*ones(1,9); a=1; [H F]=freqz(b,a,w); y=roots(b) zplane(b,1) Part 3: % 9 point running average filter b=1/9*ones(1,9); a=1; fvtool(b,a)...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

Matlab+lab+3+codes+and+plots - x=filter(b,a[1 zeros(1,20...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online