Digital Signal Octave Codes (0A)

Similar documents
Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

Digital Signal Octave Codes (0A)

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

Fourier Analysis Overview (0A)

Fourier Analysis Overview (0A)

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

Fourier Analysis Overview (0B)

General CORDIC Description (1A)

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

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

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

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

CT Rectangular Function Pairs (5B)

Capacitor Young Won Lim 06/22/2017

Capacitor in an AC circuit

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

Discrete Time Rect Function(4B)

Discrete Time Rect Function(4B)

Group & Phase Velocities (2A)

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

Signal Functions (0B)

Phasor Young Won Lim 05/19/2015

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

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

Capacitor in an AC circuit

Capacitor in an AC circuit

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

Capacitor in an AC circuit

Capacitor and Inductor

Capacitor and Inductor

Capacitors in an AC circuit

Capacitor in an AC circuit

Capacitor in an AC circuit

Capacitor in an AC circuit

Propagating Wave (1B)

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

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

Spectra (2A) Young Won Lim 11/8/12

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

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

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

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

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

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

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

Background LTI Systems (4A) Young Won Lim 4/20/15

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

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

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

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

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

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

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

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

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

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

Complex Trigonometric and Hyperbolic Functions (7A)

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

Higher Order ODE's, (3A)

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

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

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

Hilbert Inner Product Space (2B) Young Won Lim 2/7/12

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

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

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

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

Signal Processing. Young Won Lim 2/20/18

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

Signal Processing. Young Won Lim 2/22/18

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

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

Surface Integrals (6A)

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

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

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

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

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

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

Second Order ODE's (2A) Young Won Lim 5/5/15

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

FSM Examples. Young Won Lim 11/6/15

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

Background Complex Analysis (1A) Young Won Lim 9/2/14

Hyperbolic Functions (1A)

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

Surface Integrals (6A)

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

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

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

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

Signal Processing. Young Won Lim 3/3/18

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

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

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

6.1 Reciprocal, Quotient, and Pythagorean Identities.notebook. Chapter 6: Trigonometric Identities

Signal Processing. Young Won Lim 2/24/18

Transcription:

Digital Signal Periodic Conditions

Copyright (c) 2009-207 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version.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 OpenOffice and Octave.

Based on M.J. Roberts, Fundamentals of Signals and Systems S.K. Mitra, Digital Signal Processing : a computer-based approach 2nd ed S.D. Stearns, Digital Signal Processing with Examples in MATLAB 3

Sampling and Normalized Frequency ω0 t = 2π f 0t t = nt s ω0 n T s = 2 π f 0 n T s f0= = 2π nts T0 Ts : sampling period T0 T0 : signal period Ts = 2πn T0 Ts f = 0 T0 fs normalization = 2 π n F0 f0 F0 = f 0T s = fs normalization 4

Analog and Digital Frequencies Analog Signal Frequency ω0 t = 2 π f 0 t t = nt s t = nt s n ω0 T s = 2 π n f 0 T s ω 0 T s = Ω0 f 0 T s = F0 Ω0 n = 2 π n F 0 Digital Signal Frequency 5

Multiplying by Ts Normalization ω0 t = 2 π f 0 t T s T s Ω0 n = 2 π n F 0 6 Analog Signal Normalization Digital Signal

Normalization F 0 = f 0 T s f 0 T s Multiplied by Ts = f0 / fs f0 / fs Divided by fs = Ts / T0 Ω0 = 2 π F 0 7

Normalized Cyclic and Radian Frequencies Normalized Cyclic Frequency f 0 cycles/ second F 0 cycles/ sample = f s samples/ second Normalized Radian Frequency ω 0 cycles / second Ω0 cycles / sample = f s samples/ second 8

Periodic Relation : N0 and F0 e j (2 π (n+ N 0 ) F 0 ) =e j (2 π n F 0 ) e j2πm = Digital Signal Period N0 : the smallest integer e j 2 π N 0 F0 e j2πm 2 π N 0 F0 = 2 π m 9 = Periodic Condition : integer m N 0 F0 = m

Periodic Condition : N0 and F0 2 π N 0 F0 = 2 π m T0 m N0 = = m F0 Ts Digital Signal Period N0 : the smallest integer Periodic Condition : the smallest integer m N 0 F0 = m Integer * Rational : must be an Integer m Ts m= p reduced form 0

Periodic Condition : N0 and F0 in a reduced form Integer reduced form T0 m q N0 = = m = m F0 Ts p Integer * Rational : must be an Integer Rational numbers

N0 and F0 in a reduced form : Examples reduced form p F0 = q Rational m q N0 = = m F0 p integer N0 q m p integers the smallest integer m 2.678 2.339 2 = = = F0 4.07 3.339 3 m=3 N0 = 2 m 4.07 N 0 2.678 0 2 5 2 = = = F 0 5 3 5 3 m=3 N0 = 2 m 5 N 0 0 2

Periodic Relations Analog and Digital Cases e j (2 π(n+ N 0 ) F 0 ) =e j (2 π n F 0 ) e Digital Signal Period N0 : the smallest integer =e j(2 π f 0 )t Analog Signal Period T0 : the smallest real number T0 m N0 = = m F0 Ts T0 = f0 k T 0 f 0 = k k N 0 F 0 = k m integer multiple of m : some integers m j (2 π f 0 )(t +T 0 ) all integers 3

Periodic Conditions Analog and Digital Cases N F 0 = k m T f 0 = k k m N= F0 k T= f0 Integer N0 Rational F0 Minimum Integer N0 N0 = q m= p Real T0 Real f0 Minimum Real T0 T0 = f0 p F0 = q m= reduced form m N0 = p/ q 4

Periodic Conditions Examples N F 0 = k m T f 0 = k m N0 = F0 T0 = f0 Integer N given F0 = Real T given f0= km: multiples of k: all integers N 0 = m = T 0 = = 2 N 0 = 72 2 m = 72 2T 0 = 2 2 = 2 3 N 0 = 08 3 m = 08 3T 0 = 3 3 = 3 5

Periodic Condition of a Sampled Signal g(n T s ) = A cos(2 π f 0 T s n+θ) F 0 = f 0 T s = f 0/ f s g [n] = A cos(2 π F 0 n + θ) 2 π F0n = 2 π m F0 = m n F0n = m n, m integers Rational Number integers F0 = m n n, m The Smallest Integer n N 0 = min(n) F0 = m N0 M.J. Roberts, Fundamentals of Signals and Systems 6

F0 and N0 of a Sampled Signal Integer N0 Rational Number F0 F0 = m p = n q f0 Ts F0 = = fs T0 integer n, m, p, q real N 0 F0 = m f 0, f s,t s, T 0 N0 = 2 π F0 n T f m q = m 0 = m s = m F0 Ts f0 p 2π f 0T s n M.J. Roberts, Fundamentals of Signals and Systems 7

A cosine waveform example n= [0:]; x= cos(2*pi**(n/0)); n T s = n 0 2 π F0n = 2 π f 0Ts n f0 Ts F0 = f 0T s = = fs T0 n= [0:]; x= cos(2*pi*(/0)*n); n T s = n 2π f 0 nt s 2 π f 0 nt s = 2 π n 0 = 2 π n 0 T s = 0. Ts = f 0 = (T 0 = ) f 0 = 0. (T 0 =0) F 0 = f 0 T s = 0. F 0 = f 0 T s = 0. U of Rhode Island, ELE 4, FFT Tutorial 8

Two cases of the same F0 = f0 Ts cos (0.2 π n) cos(0.2 π n) cos(2 π f 0 n T s ) cos(2 π f 0 n T s ) cos(2 π 0. n) cos(2 π 0. n) T s = 0. Ts = f0= f 0 = 0. F 0 = 0. F 0 = 0. U of Rhode Island, ELE 4, FFT Tutorial

The same sampled waveform examples cos(0.2 π n) cos(0.2 π n) 2 π f 0 nt s 2 π n/0 n= [0:]; x= cos(2*pi**0.*n); 0. = f 0 T s 0. = F 0 2 π F0n = 2 π f 0Ts n n= [0:]; x= cos(2*pi*0.**n); T s = 0. T s = 0.2 T s = 0.5 Ts = f0 = f 0 = 0.5 f 0 = 0.2 f 0 = 0. F 0 = 0. F 0 = 0. F 0 = 0. F 0 = 0. U of Rhode Island, ELE 4, FFT Tutorial 20

Many waveforms share the same sampled data The same sampled data.00000 0.80902 0.30902-0.30902-0.80902 -.00000-0.80902-0.30902 0.30902 0.80902.00000 0.80902 0.30902-0.30902-0.80902 -.00000-0.80902-0.30902 0.30902 0.80902.00000 0.80902 0.30902-0.30902-0.80902 -.00000-0.80902-0.30902 0.30902 0.80902 T s = 0. T0 = 2 π n/ 0 2π nf 0T s ` 0. = f 0 T s 0. = F 0 3 T s = 0. T0 = Ts = T 0 = 0 Ts = T 0 = 0 30 U of Rhode Island, ELE 4, FFT Tutorial 2

Different number of data points x= cos(2*pi*n/0); [0,, ] 20 data points [0:]; t = [0:]/0; y = cos(2*pi*t); stem(t, y) hold on t2 = [0:9]/00; y2 = cos(2*pi*t2); plot(t2, y2) size([0:], 2) = 20 [0,,9] 200 data points [0:9]; size([0:9], 2) = 200 U of Rhode Island, ELE 4, FFT Tutorial 22

Normalized data points x= cos(2*pi*n/0); t = [0:]/0; [0.0,,.90 ] 20 data points coarse resolution t = [0:]/0; y = cos(2*pi*t); stem(t, y) hold on t2 = [0:9]/00; y2 = cos(2*pi*t2); plot(t2, y2) [0.0,,.90 ] 2 cycles t2 = [0:9]/00; [0,, 4 π ] [0.0,,.99 ] 200 data points fine resolution [0.0,,.99 ] 2 cycles [0,, 4 π ] U of Rhode Island, ELE 4, FFT Tutorial 23

Different number of data points [0,, ] 20 data points [0:]; size([0:], 2) = 20 x= cos(0.2*pi*n); t = [0:]; y = cos(0.2*pi*t); stem(t, y) hold on t2 = [0:9]/0; y2 = cos(0.2*pi*t2); plot(t2, y2) [0,,9] 200 data points [0:9]; size([0:9], 2) = 200 U of Rhode Island, ELE 4, FFT Tutorial 24

Normalized data points t = [0:]; [0.0,,.0 ] 20 data points coarse resolution [0.0,,.0 ] 2 cycles [0,, 4 π ] x= cos(0.2*pi*n); t = [0:]; y = cos(0.2*pi*t); stem(t, y) hold on t2 = [0:0]/0; y2 = cos(0.2*pi*t2); plot(t2, y2) t2 = [0:9]/0; [0.0,,.9 ] 200 data points fine resolution [0.0,,.9 ] 2 cycles [0,, 4 π ] U of Rhode Island, ELE 4, FFT Tutorial 25

Plotting sampled cosine waves x= cos(2*pi*n/0); t = [0:]/0; y = cos(2*pi*t); stem(t, y) hold on t2 = [0:9]/00; y2 = cos(2*pi*t2); plot(t2, y2) t = [0:]/0; [0.0,,.9 ] 20 data points y = cos(2*pi*t); stem(t, y) t2 = [0:9]/00; [0.0,,.99 ] 200 data points y = cos(2*pi*t2); plot(t2, y) coarse resolution fine resolution x= cos(0.2*pi*n); t = [0:]; y = cos(0.2*pi*t); stem(t, y) hold on t2 = [0:0]/0; y2 = cos(0.2*pi*t2); plot(t2, y2) t = [0:]; [0.0,,.9 ] 20 data points y = cos(0.2*pi*t); stem(t, y) t2 = [0:9]/00; y = cos(0.2*pi*t2); coarse resolution [0.0,,.99 ] 200 data points plot(t2, y) fine resolution U of Rhode Island, ELE 4, FFT Tutorial 26

Two waveforms with the same normalized frequency x= cos(2*pi*n/0); t = [0:]/0; y = cos(2*pi*t); stem(t, y) hold on t2 = [0:9]/00; y2 = cos(2*pi*t2); plot(t2, y2) x= cos(0.2*pi*n); t = [0:]; y = cos(0.2*pi*t); stem(t, y) hold on t2 = [0:0]/0; y2 = cos(0.2*pi*t2); plot(t2, y2) cos(2 π t) [0.0,,.9 ] 2 cycles cos(2 π t) cos(0.2 π t) F 0 = 0. f0 = T0 = f s = 0 T s = 0. F 0 = 0. [0.,,.] 2 cycles cos(2 π 0. t) f 0 = 0. T 0 = 0 fs= Ts = U of Rhode Island, ELE 4, FFT Tutorial 27

Cosine Wave x= cos(2*pi*n/0); cos(2 π t ) T0 = cos(2 π t) f0 = T0 = f s = 0 T s = 0. t = [0:29]/0; y = cos(2*pi*t); stem(t, y) hold on t2 = [0:299]/00; y2 = cos(2*pi*t2); plot(t2, y2) f0 = T s = 0. F 0 = f 0 T s = 0. U of Rhode Island, ELE 4, FFT Tutorial 28

Cosine Wave 2 x= cos(0.2*pi*n); cos(0.2 π t ) T 0 = 0 cos(2 π 0. t) f 0 = 0. T 0 = 0 fs= Ts = t = [0:29]; y = cos(0.2*pi*t); stem(t, y) hold on t2 = [0:299]/0; y2 = cos(0.2*pi*t2); plot(t2, y2) f 0 = 0. Ts = F 0 = f 0 T s = 0. U of Rhode Island, ELE 4, FFT Tutorial 29

Sampled Sinusoids g [n] = A cos(2 π F 0 n + θ) F0 2 π F0 g [n] = A cos(2 π n m/ N 0 + θ) m/ N0 2 πm/ N0 g[n] = A cos(ω0 n + θ) Ω0 / 2 π Ω0 N0 = g[n] = A e βn g[n] = A z n m F0 N0 F0 z = eβ M.J. Roberts, Fundamentals of Signals and Systems 30

Sampling Period Ts and Frequency fs g (t ) = A cos(2 π f 0 t +θ) F 0 f 0 T s f 0 F 0 f s Ts g [n] = A cos(2 π F 0 n + θ) Ts = fs =fs Ts sampling period sampling frequency sampling rate M.J. Roberts, Fundamentals of Signals and Systems 3

Periodic Condition Examples g (t ) = A cos(2 π f 0 t +θ) g[n] = A cos(2 π F 0 n + θ) 72 π t ( ) = 4 cos ( 2 π t ) g[t ] = 4 cos f0= 72 π n ( ) = 4 cos ( 2 π n ) g[n] = 4 cos F0 = F 0 = f 0 T s = f 0/ f s F0 = f 0T s = f 0 Ts = M.J. Roberts, Fundamentals of Signals and Systems 32

Periodic Condition Examples 72 π t ( ) = 4 cos ( 2 π t ) g (t ) = 4 cos ( 2 π (t + T )) g[t ] = 4 cos 0 T0 = 72 π n ( ) = 4 cos ( 2 π n ) g [n] = 4 cos ( 2 π (n + N ) ) g[n] = 4 cos Ts = 0 N 0 = Fundamental Period of g [n] Fundamental Period of g(t ) N0 F0 N0 = q F0 q = F0 N0 M.J. Roberts, Fundamentals of Signals and Systems 33

Periodic Condition Examples g (t ) = 4 cos 2 π (t + T 0 ) ( ) g[n] = 4 cos 2 π (n + N 0 ) ( q F0 = = N0 Fundamental Period of g(t ) N 0 = Fundamental Period of g [n] T0 = ) the number of cycles in N0 samples the smallest integer : fundamental period N0 F0 N0 = q F0 q = F0 N0 M.J. Roberts, Fundamentals of Signals and Systems 34

Periodic Condition Examples q F0 = = N0 the number of cycles in N0 samples the smallest integer : fundamental period When F0 is not the reciprocal of an integer (q=), a discrete-time sinusoid may not be immediately recognizable from its graph as a sinusoid. M.J. Roberts, Fundamentals of Signals and Systems 35

Periodic Condition Examples g[n] = 4 cos 2 π (n + N 0 ) ( ) (n + N 0 ) integer N 0 = g (t ) = 4 cos 2 π (t + T 0 ) ( ) N = k 0 integer T 0 = k integer integer integer Fundamental period of g [n] (t + T 0 ) T0 = N0 T0 integer Fundamental period of g(t ) M.J. Roberts, Fundamentals of Signals and Systems

Periodic Condition Examples g [n] = 4 cos 2 π n ) 2 g [n] = 4 cos 2 π n ) 3 g [n] = 4 cos 2 π n ) ( ( ( g [n] = 4 cos 2 π n ( ) clf n = [0:]; t = [0:00]/00; y = 4*cos(2*pi*(/)*n); y2 = 4*cos(2*pi*(2/)*n); y3 = 4*cos(2*pi*(3/)*n); y4 = 4*cos(2*pi*(/)*n); yt = 4*cos(2*pi*(/)*t); yt2 = 4*cos(2*pi*(2/)*t); yt3 = 4*cos(2*pi*(3/)*t); yt4 = 4*cos(2*pi*(/)*t); subplot(4,,); stem(n, y); hold on; plot(t, yt); subplot(4,,2); stem(n, y2); hold on; plot(t, yt2); subplot(4,,3); stem(n, y3); hold on; plot(t, yt3); subplot(4,,4); stem(n, y4); hold on; plot(t, yt4); M.J. Roberts, Fundamentals of Signals and Systems 37

Periodic Condition Examples g [n] = 4 cos 2 π n ) 2 g [n] = 4 cos 2 π n ) 3 g [n] = 4 cos 2 π n ) g [n] = 4 cos 2 π n ) ( ( ( ( N 0 = Ts = cycle 2 cycles 3 cycles cycles 38

Periodic Condition Examples g (t ) = A cos(2 π f 0 t +θ) g (t ) = 4 cos ( 2 π t ) g2 (t ) = 4 cos ( 2 π 2 t ) g3 (t ) = 4 cos ( 2 π 3 t ) t n T t nt2 t nt3 T = T2 = T3 = 0 20 30 g [n] = A cos(2 π F 0 n + θ) t n T t nt2 t nt3 g [n] = 4 cos ( 2 π n T s ) g2 [n] = 4 cos ( 2 π n T s 2 ) g3 [n] = 4 cos ( 2 π n T s 3 ) n = 0,, 2, 3, n = 0,, 2, 3, n = 0,, 2, 3, t = 0, 0., 0.2, 0.3, 2 t = 0, 0., 0.2, 0.3, 3 t = 0, 0., 0.2, 0.3, { g [n] } { g2 [n ] } { g2 [n] } M.J. Roberts, Fundamentals of Signals and Systems 39

Periodic Condition Examples g (t ) = A cos(2 π f 0 t +θ) 2 π F0n = 2 π m g [n] = A cos(2 π F 0 n + θ) n=m g [n] = 4 cos ( 72 π n m = n ) ( ( )) ( ( = 4 cos 2 π = 4 cos 2 π f0 m = = n fs n (n + N 0 ) smallest smallest n = / N 0 )) F0 = N 0 = q N0 = F0 = Ω0 /2 π M.J. Roberts, Fundamentals of Signals and Systems 40

Periodic Condition Examples 4 cos ( ω t ) 4 cos ( ω n ) t = 2t 2 n Ts = n = 2 n2 4 cos ( 2ω t 2 ) 4 cos ( ω 2n 2 ) n 2 2 Ts = 2 M.J. Roberts, Fundamentals of Signals and Systems 4

Periodic Condition Examples Ts = Ts = Ts = 0 ω = 2 π 20 ω = 2 π 2 30 clf n = [0:0]; t = [0:000]/000; y = 4*cos(2*pi**n/0); y2 = 4*cos(2*pi*2*n/20); y3 = 4*cos(2*pi*3*n/30); yt = 4*cos(2*pi*t); yt2 = 4*cos(2*pi*2*t); yt3 = 4*cos(2*pi*3*t); subplot(3,,); stem(n, y); hold on; plot(t, yt); subplot(3,,2); stem(n/20, y2); hold on; plot(t, yt2); subplot(3,,3); stem(n/30, y3); hold on; plot(t, yt3); ω = 2 π 3 M.J. Roberts, Fundamentals of Signals and Systems 42

References [] [2] [3] [4] [5] http://en.wikipedia.org/ J.H. McClellan, et al., Signal Processing First, Pearson Prentice Hall, 2003 M.J. Roberts, Fundamentals of Signals and Systems S.J. Orfanidis, Introduction to Signal Processing K. Shin, et al., Fundamentals of Signal Processing for Sound and Vibration Engineerings [6] A graphical interpretation of the DFT and FFT, by Steve Mann 43