1 / 21

ECT 358

ECT 358. Lecture 14 Digital Signal Processing. A man is rich according to what he is, not according to what he has. There is that maketh himself rich, yet hath nothing: there is that maketh himself poor, yet hath great riches. Proverbs 13:7. Signals and Sampling. Analog Input

kim-sherman
Download Presentation

ECT 358

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECT 358 Lecture 14 Digital Signal Processing

  2. A man is rich according to what he is, not according to what he has. There is that maketh himself rich, yet hath nothing: there is that maketh himself poor, yet hath great riches. Proverbs 13:7

  3. Signals and Sampling • Analog Input • Discrete Time Samples • Manipulation of Numbers • Mostly zero • Has non-zero value only at the sample points • Output at sample points approximately equals the value of the continuous signal evaluated for the sample point

  4. Signals and Sampling

  5. Discrete Linear System • Input is convolved with another function to produce an output

  6. Generalized Discrete Linear System

  7. Difference Equation • Discrete data stream, x(n), is stored in a shift register • Each stage of the shift register corresponds to the delay operation • Contents of each stage multiplied by a distinct coefficient and summed • Output is fed back through a separate shift register with corresponding multiply and add operations

  8. Finite Impulse Response Filters • If each of the b coefficients are zero, then • Represents a Finite Impulse Response (FIR) filter

  9. Finite Impulse Response Filters • Operations are delay, multiply, and accumulate the result

  10. Finite Impulse Response Filters

  11. A Simple FIR Filter • Moving Average Filter

  12. Moving Average Filter Diagram

  13. Eight Point Moving Average Filter

  14. Eight Point Moving Average Filter //MovAvg.v //A simple moving average filter to illustrate FIR filter implementation //Uses an 8 point filter //Assumes 8-bit samples module MovAvg(Y_out,temp, X_in, clk, reset); input [7:0] X_in; input clk, reset; output [7:0] Y_out; output [10:0] temp; reg [10:0] temp; reg [7:0] Y_out; reg [7:0] samples[0:6]; //reg [2:0] k; integer k;

  15. Eight Point Moving Average Filter always @(posedge clk or posedge reset) if (reset) begin for(k = 0;k <= 6;k = k+1) begin samples[k] <= 0; Y_out <= 0; temp <= 0; end end else begin temp <= samples[0] + samples[1] + samples[2] + samples[3] + samples[4] + samples[5] + samples[6] + X_in; Y_out <= temp>>3; for(k=0; k < 6; k = k+1) samples[k] <= samples[k+1]; samples[6] <= X_in; end endmodule

  16. Finite Impulse Response Filter //rect_prototype.v //a prototype rectangular digital filter example //fs = 1000 module rect_prototype(Y_out, X_in, clk, reset); input clk, reset; input [7:0] X_in; output [15:0] Y_out; reg [15:0] Y_out; reg [15:0] REG [0:20]; integer k;

  17. Finite Impulse Response Filter always @(posedge clk or posedge reset) if (reset) for (k = 0; k <= 20; k = k+1) begin REG[k] <= 0; Y_out <= 0; end else begin Y_out <= (REG[0] + REG[20])* 32 //this behavior approach to multiply causes an LPM-MULT to be used //avoid by explicitly using power of 2 multiplies (shift) and add +(REG[1] + REG[19])* 25 -(REG[3] + REG[17])* 32 -(REG[4] + REG[16])* 53 -(-REG[5] + REG[15])* 45 +(REG[7] + REG[13])* 75 +(REG[8] + REG[12])* 159 +(REG[9] + REG[20])* 225 + REG[10]*250; for(k = 0; k<20; k = k+1) begin REG[k]<= REG[k+1]; REG[20]<=X_in; end end endmodule

  18. Infinite Impulse Response Filter

  19. Low Pass Filter

  20. Low Pass Filter Response

  21. Low Pass Filter Response //IIR_LP.v /* An infinite impulse response, digital low-pass filter based on a standard continuous time filter formulation. */ module IIR_LP(yn, xn, clk, reset); parameter width = 8; parameter order = 1; /*for this filter, there is one b coefficient that has the value 0.904. We multiply by 1000 to create an integer operation. This effectively moves the "binary" point 10 positions to the left. In order for the results to converge, we must compensate for this shift in both the input and the output data*/ parameter b = 10'd904; input [width-1:0] xn; input clk, reset; output [2*width-1:0] yn; reg [3*width:0]samples_out ; wire [3*width:0]Data_feedforward; wire [3*width:0] Data_feedback; //input shifted 10 positions to the left to line up with coefficient assign Data_feedforward = xn<<10; assign Data_feedback = samples_out*b ; //output shifted 10 positions to the right to compensate for scale assign yn = (Data_feedforward + Data_feedback)>>10; always @(posedge clk) if (reset) samples_out <= 0; else samples_out <= (Data_feedforward + Data_feedback)>>10; //delayed ouput shifted 10 positions to the right to compensate for scale endmodule

More Related