Implementing real-time convolution

Slides:



Advertisements
Similar presentations
1 The 2-to-4 decoder is a block which decodes the 2-bit binary inputs and produces four output All but one outputs are zero One output corresponding to.
Advertisements

FIR Filter. C-Implementation (FIR filter) #include #include #include "coeff_ccs_16int.h" int in_buffer[300]; int out_buffer[300]; #define TRUE 1 /*Function.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #3.1 Digital Filters Chao Jia.
Basic Electric Circuits Linearity And Superposition Lesson 9.
Conventional Image Processing. grids Digital Image Notation Digital images are typically stored with the first index representing the row number and.
Systems: Definition Filter
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
Functions Definition A function from a set S to a set T is a rule that assigns to each element of S a unique element of T. We write f : S → T. Let S =
The sampling of continuous-time signals is an important topic It is required by many important technologies such as: Digital Communication Systems ( Wireless.
DSP C5000 Chapter 16 Adaptive Filter Implementation Copyright © 2003 Texas Instruments. All rights reserved.
LIST OF EXPERIMENTS USING TMS320C5X Study of various addressing modes of DSP using simple programming examples Sampling of input signal and display Implementation.
Warm up Simplify: -(2x + 3) + 4(x + 2) A – 2 – ( 3 + a) Solve: 13m – 22 = 9m -6.
Which one? You have a vector, a[ ], of random integers, which can modern CPUs do faster and why? //find max of vector of random ints max=0; for (inda=0;
Solve the following system using the elimination method.
Research Progress Seminar
Technological Educational Institute Of Crete Department Of Applied Informatics and Multimedia Neural Networks Laboratory Slide 1 DISCRETE SIGNALS AND SYSTEMS.
Dr. Engr. Sami ur Rahman Assistant Professor Department of Computer Science University of Malakand Visualization in Medicine Lecture: Convolution.
Signals and Systems Analysis NET 351 Instructor: Dr. Amer El-Khairy د. عامر الخيري.
Lesson 1.8 Complex Numbers Objective: To simplify equations that do not have real number solutions.
What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through.
Lecture 09b Finite Impulse Response (FIR) Filters
Analysis of Linear Time Invariant (LTI) Systems
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
Index Laws Whenever we have variables which contain exponents and have equal bases, we can do certain mathematical operations to them. Those operations.
Algebra Operations with Complex Numbers. Vocabulary Imaginary Number i -
1 Chapter 8 The Discrete Fourier Transform (cont.)
Complex Numbers.
Homework 3 1. Suppose we have two four-point sequences x[n] and h[n] as follows: (a) Calculate the four-point DFT X[k]. (b) Calculate the four-point DFT.
Chapter 16 Adaptive Filter Implementation
5.5 Roots of Real Numbers Definitions Simplifying Radicals
Figure 11.1 Linear system model for a signal s[n].
Digital Signal Processing
Example: Solve the equation. Multiply both sides by 5. Simplify both sides. Add –3y to both sides. Simplify both sides. Add –30 to both sides. Simplify.
Implementation of Convolution using C++
10.3 Quadratic Equations from their solutions
Lab 4 Application of RTOS
Lecture 12 Linearity & Time-Invariance Convolution
Discrete-Time Structure
Perform Operations with Complex Numbers
Multiplying Real Numbers
The Rational Zero Theorem
Operations with Complex Numbers
Warm Up Solve each equation. 1. –5a = –6 –
ECET 350 Competitive Success/snaptutorial.com
5.4 Complex Numbers.
Chapter 16 Adaptive Filters
شاخصهای عملکردی بیمارستان
Lecture 4: Discrete-Time Systems
Lect5 A framework for digital filter design
The Z-Transform of a given discrete signal, x(n), is given by:
UNIT V Linear Time Invariant Discrete-Time Systems
فرق بین خوب وعالی فقط اندکی تلاش بیشتر است
Z TRANSFORM AND DFT Z Transform
Lial/Hungerford/Holcomb/Mullins: Mathematics with Applications 11e Finite Mathematics with Applications 11e Copyright ©2015 Pearson Education, Inc. All.
4.6 Perform Operations with Complex Numbers
Digital Signal Processing
HW-03 Problem Kuo-95 (p. 377) Find the steady-state errors for step, ramp and parabolic inputs. Determine the type of the system. ) s ( R Problem.
The Rational Zero Theorem
FIR and IIR Filters with on and off Functionality
Getting serious about “going fast” on the TigerSHARC
3.8 Use Inverse Matrices to Solve Linear Systems
Zhongguo Liu Biomedical Engineering
5.4 Complex Numbers.
Concept of frequency in Discrete Signals & Introduction to LTI Systems
Warm-Up Honors Algebra 2 4/18/18
Domain ( Input ): 2, 4, 5, 7 Range ( Output ): 32, 59, 65, 69, 96.
Slope intercept form is:
Multiplying more than two integers
Presentation transcript:

Implementing real-time convolution Circular buffer Implementing real-time convolution

Problem Statement Implement the 4-th order FIR filter shown in Figure 3.2 on page 28. n = 4 x[] is the buffer for the input b[] is the coefficients vector the newest input will be multiplied by b[0] while the oldest will be multiplied by b[4] y is the output to the DAC sn denotes the value of the n-th input sample

Initially The system is relaxed, that is, the input buffer is filled with 0. x[0] = x[1] = … = x[4] = 0 We need an index idx to denote where is the latest input. Initially, idx = 0. that means x[0] will hold the current input at t = 0. Note that’s different from what we did in problem 2 where x[n] ALWAYS stores the latest input.

t = 0 idx = 0 x[] 1 2 3 4 s0 b[] b[0] b[1] b[2] b[3] b[4] 1 2 3 4 s0 b[] b[0] b[1] b[2] b[3] b[4] y = x[idx] * b[0] = x[0] * b[0]

t = 1 idx= 0+1=1 x[] 1 2 3 4 s0 s1 b[] b[0] b[1] b[2] b[3] b[4] 1 2 3 4 s0 s1 b[] b[0] b[1] b[2] b[3] b[4] y = x[idx] * b[0] + x[idx-1] * b[1] = x[1] * b[0] + x[0] * b[1]

t = 4 idx = 3+1 = 4 x[] 1 2 3 4 s0 s1 s2 s3 s4 b[] b[0] b[1] b[2] b[3] 1 2 3 4 s0 s1 s2 s3 s4 b[] b[0] b[1] b[2] b[3] b[4] y = x[i] * b[0] + x[i-1] * b[1] + x[i-2] * b[2] + x[i-3] * b[3] + x[i-4] * b[4] = x[4] * b[0] + x[3] * b[1] + x[2] * b[2] + x[1] * b[3] + x[0] * b[4]

t = 5 idx = 4 +1 = 5 = 0 x[] 1 2 3 4 s5 s1 s2 s3 s4 b[] b[0] b[1] b[2] 1 2 3 4 s5 s1 s2 s3 s4 b[] b[0] b[1] b[2] b[3] b[4] y = x[idx] * b[0] + x[idx-1] * b[1] + x[idx-2] * b[2] + x[idx-3] * b[3] + x[idx-4] * b[4] = x[0] * b[0] + x[-1] * b[1] + x[-2] * b[2] + x[-3] * b[3] + x[-4] * b[4] = x[0] * b[0] + x[4] * b[1] + x[3] * b[2] + x[2] * b[3] + x[1] * b[4]

Mod operator b[0] should be always multiplied by the latest data while b[4] times the oldest one. Also notice the negative indexes in the equation. Since it’s a “circular” buffer, x[-1] stands for x[4] But how to mathematically convert -1 to 4? Mod operation: (k + n) mod n = k mod n (3+5) mod 5 = 3 mod 5 =3 (-1+5) mod 5 = 4 mod 5 = 4 In C/C++, % is the mod operator

Solution #define N 4 int idx = 0; int i; float y; Interrupt void McBSP_Rx_ISR() { … idx = (idx+1) % (N+1); y = 0.0; for (i=0; i<=N;i++) y = y + x[(idx-i+N+1)%(N+1)] * b[i]; }