Signal Processing. Young Won Lim 2/22/18

Similar documents
Signal Processing. Young Won Lim 2/20/18

Signal Processing. Young Won Lim 2/24/18

Signal Processing. Young Won Lim 3/3/18

Relations (3A) Young Won Lim 3/27/18

Up-Sampling (5B) Young Won Lim 11/15/12

Higher Order ODE's (3A) Young Won Lim 7/7/14

Down-Sampling (4B) Young Won Lim 11/15/12

Higher Order ODE's (3A) Young Won Lim 12/27/15

Down-Sampling (4B) Young Won Lim 10/25/12

Audio Signal Generation. Young Won Lim 2/2/18

Audio Signal Generation. Young Won Lim 1/29/18

DFT Frequency (9A) Each Row of the DFT Matrix. Young Won Lim 7/31/10

Audio Signal Generation. Young Won Lim 2/2/18

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

Expected Value (10D) Young Won Lim 6/12/17

General CORDIC Description (1A)

Fourier Analysis Overview (0A)

Matrix Transformation (2A) Young Won Lim 11/10/12

Capacitor in an AC circuit

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

Higher Order ODE's (3A) Young Won Lim 7/8/14

Fourier Analysis Overview (0B)

Digital Signal Octave Codes (0A)

Capacitor Young Won Lim 06/22/2017

Digital Signal Octave Codes (0A)

Fourier Analysis Overview (0A)

ODE Background: Differential (1A) Young Won Lim 12/29/15

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

CT Rectangular Function Pairs (5B)

Background Trigonmetry (2A) Young Won Lim 5/5/15

The Growth of Functions (2A) Young Won Lim 4/6/18

Differentiation Rules (2A) Young Won Lim 1/30/16

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Group & Phase Velocities (2A)

General Vector Space (2A) Young Won Lim 11/4/12

Discrete Time Rect Function(4B)

Differentiation Rules (2A) Young Won Lim 2/22/16

Complex Trigonometric and Hyperbolic Functions (7A)

Root Locus (2A) Young Won Lim 10/15/14

Bayes Theorem (4A) Young Won Lim 3/5/18

Resolution (7A) Young Won Lim 4/21/18

Discrete Time Rect Function(4B)

Matrix Transformation (2A) Young Won Lim 11/9/12

Implication (6A) Young Won Lim 3/17/18

FFT Octave Codes (1B) Young Won Lim 7/6/17

Signal Functions (0B)

Group Delay and Phase Delay (1A) Young Won Lim 7/19/12

Separable Equations (1A) Young Won Lim 3/24/15

Detect Sensor (6B) Eddy Current Sensor. Young Won Lim 11/19/09

Higher Order ODE's, (3A)

Definitions of the Laplace Transform (1A) Young Won Lim 1/31/15

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 10/22/12

Hamiltonian Cycle (3A) Young Won Lim 5/5/18

DFT Octave Codes (0B) Young Won Lim 4/15/17

Introduction to ODE's (0A) Young Won Lim 3/9/15

Capacitor in an AC circuit

Dispersion (3A) 1-D Dispersion. Young W. Lim 10/15/13

Capacitor and Inductor

Capacitor and Inductor

Bayes Theorem (10B) Young Won Lim 6/3/17

Capacitor in an AC circuit

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Group Velocity and Phase Velocity (1A) Young Won Lim 5/26/12

Capacitor in an AC circuit

Propagating Wave (1B)

Implication (6A) Young Won Lim 3/12/18

Complex Series (3A) Young Won Lim 8/17/13

Bandpass Sampling (2B) Young Won Lim 3/27/12

Capacitor in an AC circuit

Capacitor in an AC circuit

Phasor Young Won Lim 05/19/2015

Capacitor in an AC circuit

Linear Equations with Constant Coefficients (2A) Young Won Lim 4/13/15

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Capacitors in an AC circuit

Undersampling (2B) Young Won Lim 4/4/12

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Magnetic Sensor (3B) Magnetism Hall Effect AMR Effect GMR Effect. Young Won Lim 9/23/09

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Complex Functions (1A) Young Won Lim 2/22/14

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 11/2/12

First Order Logic Implication (4A) Young W. Lim 4/6/17

General Vector Space (3A) Young Won Lim 11/19/12

Introduction to ODE's (0P) Young Won Lim 12/27/14

CLTI Differential Equations (3A) Young Won Lim 6/4/15

E : Lecture 1 Introduction

Sequential Circuit Timing. Young Won Lim 11/6/15

Signals and Spectra (1A) Young Won Lim 11/26/12

Utility Functions Octave Codes (0A) Young Won Lim 1/24/18

CT Correlation (2A) Young Won Lim 9/9/14

CLTI System Response (4A) Young Won Lim 4/11/15

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

butter butter Purpose Syntax Description Digital Domain Analog Domain

Background ODEs (2A) Young Won Lim 3/7/15

FSM Examples. Young Won Lim 11/6/15

Logic Background (1A) Young W. Lim 5/14/18

EEL3135: Homework #4

Probability (10A) Young Won Lim 6/12/17

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 with Free Software : Practical Experiments F. Auger 3

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 4

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. a = [a(1), a(2),,a(n+1)] b = [b(1), b(2),,b(m+1)] length(a) = N +1 length(b) = M +1 x = [ x(1), x(2),, x (L+1)] length(x) = L+1 1 n L+1 https://octave.sourceforge.io/octave/function/filter.html 5

filter (3) The result is calculated over the first non-singleton dimension of x or over dim if supplied. x (1), x (2), x (3),, x( K ) x (1), x (2), x (3),, x( K ) x(1, 1), x(1, 2), x (1, 3),, x(1, K ) x (2, 1), x (2, 2), x (2, 3),, x (2, K ) x (3, 1), x (3, 2), x (3, 3),, x (3, K ) y (1, 1), y (1, 2), y(1, 3),, y(1, K ) y (2, 1), y(2, 2), y (2, 3),, y (2, K ) y (3, 1), y(3, 2), y (3, 3),, y (3, K ) x (L,1), x( L,2), x( L,3),, x (L, K ) y (L, 1), y (L,2), y (L, 3),, y(l, K ) x ( :, 1), x( :, 2), x( :, 3),, x ( :, K ) y ( :, 1), y ( :, 2), y ( :, 3),, y ( :, K ) https://octave.sourceforge.io/octave/function/filter.html 6

filter (4) N k=0 M a(k +1) y (n k) = b (k +1)x (n k) k=0 for 1 n length(x) N a(1) y (n) + k=1 N a(1) y (n) = k=1 M a(k+1) y(n k ) = b(k+1)x(n k) k=0 M a(k +1) y (n k) + b(k+1) x(n k ) k=0 y (n) = N k=1 a(k+1) a(1) y (n k) + M b(k +1) x(n k) k=0 a(1) 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 7

filter (5) si : the initial state of the system sf : the final state the state vector is a column vector whose length is equal to the length of the longest coefficient vector 1 No si is presented, the zero initial state. 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 8

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 9

freqz (2) Return the complex frequency response h of the rational IIR filter with the numerator coefficients b and the denominator coefficients a The response is evaluated at n angular frequencies between 0 and 2*pi. The output value w is a vector of the frequencies. h : the frequency response vector w : the frequency vector https://octave.sourceforge.io/octave/function/freqz.html 10

freqz (3) 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 11

freqz (4) freqz (b, a, w) Evaluate the response at the specific frequencies in the vector w. The values for w are measured in radians. freqz ( ) Plot the magnitude and phase response of h rather than returning them. https://octave.sourceforge.io/octave/function/freqz.html 12

freqz (5) [ ] = 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. [h, w] = freqz (b, a, n, "whole", Fs) [h, w] = freqz (b, Fs) [h, w] = freqz (b, a, Fs) [h, w] = freqz (b, a, n, Fs) h = freqz (b, a, w, Fs) https://octave.sourceforge.io/octave/function/freqz.html 13

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 14

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 length(a). https://octave.sourceforge.io/octave/function/conv.html 15

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. https://octave.sourceforge.io/octave/function/fftconv.html 16

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 17

Low Pass filter t = 0: 1/100 : 1; x = sin(2 * pi * t); x = (x > 0); x = (x 0.5) * 2; xd = [x 0 0 0]; for i=1 : length(x) y(i) = xd(i) + xd(i+1) + xd(i+2) + xd(i+3)) / 4; endfor hold plot(t, x) plot(t, y, m ); DSP for sound engineers (in Korean), J.W. Chae 18

Low Pass filter ir = zeros(1, 44100); ir(1:2) = 0.5; irfft = abs(fft(ir)); irfft = irfft(1: 22050); plot(irfft) ir = zeros(1, 44100); ir(1:3) = 0.333; irfft = abs(fft(ir)); irfft = irfft(1: 22050); plot(irfft) ir = zeros(1, 44100); ir(1:4) = 0.25; irfft = abs(fft(ir)); irfft = irfft(1: 22050); plot(irfft) DSP for sound engineers (in Korean), J.W. Chae 19

Low Pass filter h0=0.36281; h1= 0.28920; h2 = 0.12082; sys = zeros(1, 44100); sys(1)=h2; sys(2) = h1; sys(3)=h0; sys(4)=h1; sys(5)=h2; sysft = abs( fft(sys) ); sysft = sysft(1: 44100/2); plot(sysft) DSP for sound engineers (in Korean), J.W. Chae 20

High Pass filter ir=zeros(1, 44100); Ir(1)=0.5; Ir(2)=-0.5; irfft=abs(fft(ir)); Irfft = irfft(1: 22050); plot(irfft); DSP for sound engineers (in Korean), J.W. Chae 21

High Pass filter h0=0.63719; h1 = 0.28920; h2 = 0.12082; sys = zeros(1, 44100); sys(1) = h2; sys(2) =- h1; sys(3) = h0; sys(4)=-h1; sys(5)=h2; sysft = abs(fft(sys)); sysft = sysft(1: 44100/2); plot(sysft); DSP for sound engineers (in Korean), J.W. Chae 22

--plot gnuplot octave sox --plot gnuplot s6s.wav -n fir 0.1 0.2 0.4 0.3 >fir1.plt sox --plot gnuplot s6s.wav -n fir coeff.txt >fir2.plt sox --plot gnuplot s6s.wav -n biquad.6.2.4 1-1.5.6 >fir3.plt sox --plot gnuplot s6s.wav -n fir 0.2 0.2 0.2 0.2 0.2 >fir4.plt 23

--plot gnuplot octave 24

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