I. Filtering Basics
Ii. Difference Equation
1. Definition
2. Solutions to the Difference Equation
(1)
% Solution difference equation Y [N]-0.95y [n-1] + 0.9025y [N-2] = 1/3 [x [N] + X [n-1] + X [N-2], n> = 0% X [N] = cos (PIN/3), Y [-1] =-2, Y [-2] =-3, X [-1] = 1, x [-2] = 1B = [0.95, 1]/3; A = [1,-0.9025,]; y = [-2,-3]; X = [0.5]; xic = filtic (B, A, Y, x) bxplus = [1,-]; axplus = [1,-1, 1]; ayplus = Conv (A, axplus) byplus = Conv (B, bxplus) + Conv (xic, axplus) [R, P, c] = residuez (byplus, ayplus) MP = ABS (P), AP = angle (P)/pin = [0: 50]; X = cos (pI * n/3 ); y = filter (B, A, X, xic); plot (n, Y), title ('System response curve ');
Here, xic = fitltic (B, A, Y, x), that is, the initial condition for the implementation of the transpose directly type 2 filter.
(2)
% Solution difference equation Y [N]-0.95y [n-1] + 0.9025y [N-2] = 1/3 [x [N] + X [n-1] + X [N-2], n> = 0% X [N] indicates the collected signal. Y [-1] =-2, Y [-2] =-3, X [-1] = 1, X [-2] = 1B = [0.95, 1]/3; A = [1,-0.9025,]; y = [-2,-3]; X = [0.5]; xic = filtic (B, A, Y, x) bxplus = [1,-]; axplus = [1,-]; ayplus = Conv (A, axplus) byplus = Conv (B, bxplus) + Conv (xic, axplus) [R, P, C] = residuez (byplus, ayplus) MP = ABS (P), AP = angle (P)/pin = [0: 50]; [x, FS] = audioread ('e: test1.wma '); % self-input WMA file x = x (:, 1); % Single Channel ? Y = filter (B, A, X, xic); figuresubplot (211), plot (x), title ('input signal curve '); subplot (212 ), plot (Y), title ('signal curve after differential equation operation Process') Sound (x, FS); sound (Y, FS)
% Solution difference equation Y [N]-0.95y [n-1] + 0.9025y [N-2] = 1/3 [x [N] + X [n-1] + X [N-2], n> = 0% X [N] indicates the collected signal. Y [-1] =-2, Y [-2] =-3, X [-1] = 1, X [-2] = 1B = [0.95, 1]/3; A = [1,-0.9025,]; y = [-2,-3]; X = [0.5]; xic = filtic (B, A, Y, x) bxplus = [1,-]; axplus = [1,-]; ayplus = Conv (A, axplus) byplus = Conv (B, bxplus) + Conv (xic, axplus) [R, P, C] = residuez (byplus, ayplus) MP = ABS (P), AP = angle (P)/pin = [0: 50]; [x, FS, BITs] = wavread ('d: liulili.wav '); % self-input WAV file x = x (:, 1 ); % Single channel? Y = filter (B, A, X, xic); figuresubplot (211), plot (x), title ('input signal curve '); subplot (212 ), plot (Y), title ('signal curve after differential equation operation Process') Sound (x, FS); sound (Y, FS)
Digital Signal Processing (2)