Octave Functions for Filters. Young Won Lim 2/19/18

Similar documents
EEO 401 Digital Signal Processing Prof. Mark Fowler

ELEC3104: Digital Signal Processing Session 1, 2013

Filters. Phani Chavali

Brief Introduction to Signals & Systems. Phani Chavali

Analog Lowpass Filter Specifications

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

UNIT-II MYcsvtu Notes agk

Matlab Exercises. Matlab Exercises 1

3 Analog filters. 3.1 Analog filter characteristics

Infinite Impulse Response (IIR) Filter. Ikhwannul Kholis, ST., MT. Universitas 17 Agustus 1945 Jakarta

ECSE-4760 Computer Applications Laboratory DIGITAL FILTER DESIGN

Copyright S. K. Mitra

Massachusetts Institute of Technology Department of Electrical Engineering & Computer Science 6.341: Discrete-Time Signal Processing Fall 2005

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

ELEC-C5230 Digitaalisen signaalinkäsittelyn perusteet

8: IIR Filter Transformations

ijdsp Workshop: Exercise 2012 DSP Exercise Objectives

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY DIGITAL SIGNAL PROCESSING UNIT 3

Digital Processing of Continuous-Time Signals

4. Design of Discrete-Time Filters

LECTURER NOTE SMJE3163 DSP

Digital Processing of

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

IIR Filter Design Chapter Intended Learning Outcomes: (i) Ability to design analog Butterworth filters

EEM478-DSPHARDWARE. WEEK12:FIR & IIR Filter Design

Digital Filters IIR (& Their Corresponding Analog Filters) 4 April 2017 ELEC 3004: Systems 1. Week Date Lecture Title

EEO 401 Digital Signal Processing Prof. Mark Fowler

Electrical & Computer Engineering Technology

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

Digital Filter Design

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

Digital Filters FIR and IIR Systems

ECE 4213/5213 Homework 10

Analog Filter Design. Part. 2: Scipy (Python) Signals Tools. P. Bruschi - Analog Filter Design 1

Digital Filter Design using MATLAB

Performance Evaluation of Mean Square Error of Butterworth and Chebyshev1 Filter with Matlab

Lab 4 An FPGA Based Digital System Design ReadMeFirst

NOVEMBER 13, 1996 EE 4773/6773: LECTURE NO. 37 PAGE 1 of 5

Design IIR Filters Using Cascaded Biquads

Signal processing preliminaries

Plot frequency response around the unit circle above the Z-plane.

Lab 6 rev 2.1-kdp Lab 6 Time and frequency domain analysis of LTI systems

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

APPENDIX A to VOLUME A1 TIMS FILTER RESPONSES

Signal Processing. Naureen Ghani. December 9, 2017

A filter is appropriately described by the transfer function. It is a ratio between two polynomials

Filter Approximation Concepts

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

EE 470 Signals and Systems

Design of IIR Digital Filters with Flat Passband and Equiripple Stopband Responses

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

FIR Filters in Matlab

Digital Signal Processing

ASN Filter Designer Professional/Lite Getting Started Guide

Digital Filtering: Realization

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

Rahman Jamal, et. al.. "Filters." Copyright 2000 CRC Press LLC. <

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

Designing Filters Using the NI LabVIEW Digital Filter Design Toolkit

Application Note 7. Digital Audio FIR Crossover. Highlights Importing Transducer Response Data FIR Window Functions FIR Approximation Methods

Signal Analysis. Young Won Lim 2/9/18

Comparative Study of RF/microwave IIR Filters by using the MATLAB

Design of FIR Filters

Spring 2014 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

Review of Filter Types

Filter Banks I. Prof. Dr. Gerald Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany. Fraunhofer IDMT

AUDIO SIEVING USING SIGNAL FILTERS

DSP Filter Design for Flexible Alternating Current Transmission Systems

4/14/15 8:58 PM C:\Users\Harrn...\tlh2polebutter10rad see.rn 1 of 1

Part B. Simple Digital Filters. 1. Simple FIR Digital Filters

Problem Point Value Your score Topic 1 28 Discrete-Time Filter Analysis 2 24 Upconversion 3 30 Filter Design 4 18 Potpourri Total 100

SGN Bachelor s Laboratory Course in Signal Processing Audio frequency band division filter ( ) Name: Student number:

UNIVERSITY OF SWAZILAND

DESIGN OF FIR AND IIR FILTERS

FINITE IMPULSE RESPONSE (FIR) FILTERS

ECE 5650/4650 MATLAB Project 1

Final Exam Solutions June 14, 2006

EC6502 PRINCIPLES OF DIGITAL SIGNAL PROCESSING

Biosignal filtering and artifact rejection. Biosignal processing, S Autumn 2012

Bode plot, named after Hendrik Wade Bode, is usually a combination of a Bode magnitude plot and Bode phase plot:

Experiment 2 Effects of Filtering

EE 422G - Signals and Systems Laboratory

EECE 301 Signals & Systems Prof. Mark Fowler

Frequency-Response Masking FIR Filters

ECE503: Digital Filter Design Lecture 9

Biosignal filtering and artifact rejection. Biosignal processing I, S Autumn 2017

ECE 5650/4650 Exam II November 20, 2018 Name:

Lab S-5: DLTI GUI and Nulling Filters. Please read through the information below prior to attending your lab.

Signal Analysis. Young Won Lim 2/10/18

Kerwin, W.J. Passive Signal Processing The Electrical Engineering Handbook Ed. Richard C. Dorf Boca Raton: CRC Press LLC, 2000

The University of Texas at Austin Dept. of Electrical and Computer Engineering Final Exam

Digital Signal Processing for Audio Applications

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

Noise removal example. Today s topic. Digital Signal Processing. Lecture 3. Application Specific Integrated Circuits for

Transactions on Engineering Sciences vol 3, 1993 WIT Press, ISSN

Multirate DSP, part 1: Upsampling and downsampling

4 Filter Analysis and Design

Figure z1, Direct Programming Method ... Numerator Denominator... Vo/Vi = N(1+D1) Vo(1+D ) = ViN Vo = ViN-VoD

1. Find the magnitude and phase response of an FIR filter represented by the difference equation y(n)= 0.5 x(n) x(n-1)

Transcription:

Copyright (c) 2016 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice.

Based on Signal Processing with Free Software : Practical Experiments F. Auger 3

IIR Filter Design (1) besselap Return bessel analog filter prototype. besself Generate a Bessel filter. bilinear Transform a s-plane filter specification into a z-plane specification. buttap Design lowpass analog Butterworth filter. butter Generate a Butterworth filter. buttord Compute the minimum filter order of a Butterworth filter with the desired response characteristics. cheb Returns the value of the nth-order Chebyshev polynomial calculated at the point x. cheb1ap Design lowpass analog Chebyshev type I filter. cheb1ord Compute the minimum filter order of a Chebyshev type I filter with the desired response characteristics. cheb2ap Design lowpass analog Chebyshev type II filter. cheb2ord Compute the minimum filter order of a Chebyshev type II filter with the desired response characteristics. cheby1 Generate a Chebyshev type I filter with RP db of passband ripple. cheby2 Generate a Chebyshev type II filter with RS db of stopband attenuation. https://octave.sourceforge.io/signal/overview.html 4

IIR Filter Design (2) ellip Generate an elliptic or Cauer filter with RP db of passband ripple and RS db of stopband attenuation. ellipap Design lowpass analog elliptic filter. ellipord Compute the minimum filter order of an elliptic filter with the desired response characteristics. iirlp2mb IIR Low Pass Filter to Multiband Filter Transformation impinvar Converts analog filter with coefficients B and A to digital, conserving impulse response. invimpinvar Converts digital filter with coefficients B and A to analog, conserving impulse response. ncauerusage: [Zz, Zp, Zg] = ncauer(rp, Rs, n) pei_tseng_notch Return coefficients for an IIR notch-filter with one or more filter frequencies and according (very narrow) bandwidths to be used with 'filter' or 'filtfilt'. sftrans Transform band edges of a generic lowpass filter (cutoff at W=1) represented in splane zero-pole-gain form. https://octave.sourceforge.io/signal/overview.html 5

FIR Filter Design cl2bp Constrained L2 bandpass FIR filter design. fir1produce an order N FIR filter with the given frequency cutoff W, returning the N+1 filter coefficients in B. fir2produce an order N FIR filter with arbitrary frequency response M over frequency bands F, returning the N+1 filter coefficients in B. firls FIR filter design using least squares method. kaiserord Return the parameters needed to produce a filter of the desired specification from a Kaiser window. qp_kaiser Computes a finite impulse response (FIR) filter for use with a quasiperfect reconstruction polyphase-network filter bank. remez Parks-McClellan optimal FIR filter design. sgolay Computes the filter coefficients for all Savitzsky-Golay smoothing filters of order p for length n (odd). https://octave.sourceforge.io/signal/overview.html 6

filter (1) : y = filter (b, a, x) : [y, sf] = filter (b, a, x, si) : [y, sf] = filter (b, a, x, [], dim) : [y, sf] = filter (b, a, x, si, dim) https://octave.sourceforge.io/octave/function/filter.html 7

filter (2) Apply a 1-D digital filter to the data x. filter returns the solution to the following linear, time-invariant difference equation: N k=0 M a(k +1) y (n k) = b (k +1)x (n k) k=0 for 1 n length(x) where N=length(a)-1 and M=length(b)-1. The result is calculated over the first non-singleton dimension of x or over dim if supplied. An equivalent form of the equation is: N y (n) = k=1 M c(k+1) y(n k) + d(k +1)x (n k) k=0 for 1 n length(x) where c = a/a(1) and d = b/a(1). https://octave.sourceforge.io/octave/function/filter.html 8

filter (3) If the fourth argument si is provided, it is taken as the initial state of the system and the final state is returned as sf. The state vector is a column vector whose length is equal to the length of the longest coefficient vector minus one. If si is not supplied, the initial state vector is set to all zeros. In terms of the Z Transform, y is the result of passing the discrete-time signal x through a system characterized by the following rational system function: H (z) = M k=0 N 1+ k=1 d (k +1)z k c(k +1) z k https://octave.sourceforge.io/octave/function/filter.html 9

filter2 (1) : y = filter2 (b, x) : y = filter2 (b, x, shape) https://octave.sourceforge.io/octave/function/filte2r.html 10

filter2 (2) Apply the 2-D FIR filter b to x. If the argument shape is specified, return an array of the desired shape. Possible values are: "full" "same" "valid" pad x with zeros on all sides before filtering. unpadded x (default) trim x after filtering so edge effects are no included. Note this is just a variation on convolution, with the parameters reversed and b rotated 180 degrees. https://octave.sourceforge.io/octave/function/filte2r.html 11

freqz (1) : [h, w] = freqz (b, a, n, "whole") : [h, w] = freqz (b) : [h, w] = freqz (b, a) : [h, w] = freqz (b, a, n) : h = freqz (b, a, w) : [h, w] = freqz (, Fs) : freqz ( ) https://octave.sourceforge.io/octave/function/freqz.html 12

freqz (2) Return the complex frequency response h of the rational IIR filter whose numerator and denominator coefficients are b and a, respectively. The response is evaluated at n angular frequencies between 0 and 2*pi. The output value w is a vector of the frequencies. If a is omitted, the denominator is assumed to be 1 (this corresponds to a simple FIR filter). If n is omitted, a value of 512 is assumed. For fastest computation, n should factor into a small number of small primes. If the fourth argument, "whole", is omitted the response is evaluated at frequencies between 0 and pi. https://octave.sourceforge.io/octave/function/freqz.html 13

freqz (3) freqz (b, a, w) Evaluate the response at the specific frequencies in the vector w. The values for w are measured in radians. [ ] = freqz (, Fs) Return frequencies in Hz instead of radians assuming a sampling rate Fs. If you are evaluating the response at specific frequencies w, those frequencies should be requested in Hz rather than radians. freqz ( ) Plot the magnitude and phase response of h rather than returning them. https://octave.sourceforge.io/octave/function/freqz.html 14

freqz_plot : freqz_plot (w, h) : freqz_plot (w, h, freq_norm) Plot the magnitude and phase response of h. If the optional freq_norm argument is true, the frequency vector w is in units of normalized radians. If freq_norm is false, or not given, then w is measured in Hertz. https://octave.sourceforge.io/octave/function/freqz_plot.html 15

conv : conv (a, b) : conv (a, b, shape) Convolve two vectors a and b. The output convolution is a vector with length equal to length (a) + length (b) - 1. When a and b are the coefficient vectors of two polynomials, the convolution represents the coefficient vector of the product polynomial. The optional shape argument may be shape = "full" Return the full convolution. (default) shape = "same" Return the central part of the convolution with the same size as a. https://octave.sourceforge.io/octave/function/conv.html 16

conv2 : conv2 (A, B) : conv2 (v1, v2, m) : conv2 (, shape) Return the 2-D convolution of A and B. The size of the result is determined by the optional shape argument which takes the following values shape = "full" Return the full convolution. (default) shape = "same" Return the central part of the convolution with the same size as A. The central part of the convolution begins at the indices floor ([size(b)/2] + 1). shape = "valid" Return only the parts which do not include zero-padded edges. The size of the result is max (size (A) - size (B) + 1, 0). When the third argument is a matrix, return the convolution of the matrix m by the vector v1 in the column direction and by the vector v2 in the row direction. https://octave.sourceforge.io/octave/function/conv2.html 17

fftconv : fftconv (x, y) : fftconv (x, y, n) Convolve two vectors using the FFT for computation. c = fftconv (x, y) returns a vector of length equal to length (x) + length (y) - 1. If x and y are the coefficient vectors of two polynomials, the returned value is the coefficient vector of the product polynomial. The computation uses the FFT by calling the function fftfilt. If the optional argument n is specified, an N-point FFT is used. See also: deconv, conv, conv2. https://octave.sourceforge.io/octave/function/fftconv.html 18

deconv : deconv (y, a) Deconvolve two vectors. [b, r] = deconv (y, a) solves for b and r such that y = conv (a, b) + r. If y and a are polynomial coefficient vectors, b will contain the coefficients of the polynomial quotient and r will be a remainder polynomial of lowest order. https://octave.sourceforge.io/octave/function/deconv.html 19

References [1] F. Auger, Signal Processing with Free Software : Practical Experiments