Introduction to Matlab VLSI Signal Processing Lab NCTU
Introduction to Matlab 郭羽庭 VLSI Signal Processing Lab, NCTU 12/07, 2010 *source: “張智星, Matlab 程式設計與應用, 清蔚科技出版”
Outline n n n Introduction Environment Basic operations Filter design Example On-line resources
Environment n n Command window Workspace window Current directory Command history
Outline n n n Introduction Environment Basic operations Filter design On-line resources
Outline n n n Introduction Environment Basic operations Filter design On-line resources
Filter Representation in Matlab n Digital filter representation q q q n B(ejw) b(1) + b(2)e-jw +. . + b(m+1)e-jmw H(ejw) = -------------------------A(ejw) a(1) + a(2)e-jw +. . + a(n+1)e-jnw A filter is specified by the two vectore a and b
Filter Response Analysis n [H, W] = freqz(b, a, N) q n returns the N-point complex frequency response vector H and the N-point frequency vector W in radians/sample of the filter Use plot command to plot the frequency response q q Plot( w/pi, db(abs(H)) ) Axis([0 1 -150 10])
Filter Response Analysis (cont’d) n freqz(B, A, . . . ) with no output arguments plots the response
FDATool n Type fdatool in the command window q q Choose filter type Set constraints Design filter File > export
Example 2. 1 n n n n A=1; n_max = 11; n = -n_max: 1: n_max; X = zeros(size(n)); I = find(n==1); II = find (n==-1); III = find(mod(n, 2)==0); X(I) = -j*A/4; X(II) = j*A/4; X(III) = A. /(pi*(1. -n(III). ^2)); [arg_X, mag_X] = cart 2 pol(real(X), imag(X)); stem(n, mag_X); stem(n, arg_X);
On-line Resources n MATLAB 程式設計與應用(網路版), 張智星 q n Matlab線上教材 q n http: //www. cs. nthu. edu. tw/~jang/mlbook/ http: //libai. math. ncu. edu. tw/bcc 16/B/matlab/ Matlab 簡介, 馮丁樹 q http: //ecaaser 5. ecaa. ntu. edu. tw/weifang/matlab/index-matlab. htm
- Slides: 20