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 f s > 2 f 0 f 0 / f s < 0.5 Sampling Rate Minimum Ω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(2 π f 0 t ) cos(2 π f 0 t ) many possible F 0 ' s T s specifies f 0 T s specifies F 0 many possible f 0 ' s cos(2 π F 0 n) cos(2 π F 0 n) 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
f0 and F0 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 72 π n ( ) = 4 cos ( 2 π n ) g[n] = 4 cos f0= there are many F0 Ts = f0 F0 = f 0T s = fs F0 = f 0 F0 = M.J. Roberts, Fundamentals of Signals and Systems 32
T0 and N0 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 ( ) = 4 cos ( 2 π n ) g (t ) = 4 cos 2 π (t + T 0 ) ( g [n] = 4 cos 2 π (n + N 0 ) ) T0 = 72 π n g[n] = 4 cos ( there is only one N0 for a given F0 Fundamental Period of g(t ) ) N 0 = Fundamental Period of g [n] M.J. Roberts, Fundamentals of Signals and Systems 33
Real T0 and Integer N0 g[n] = 4 cos 2 π (n + N 0 ) ( ) (n + N 0 ) integer N 0 = g (t ) = 4 cos 2 π (t + T 0 ) ( ) N 0 N 0 = integer integer Fundamental period of g [n] (t + T 0 ) T 0 T0 = integer integer integer T0 = Fundamental period of g(t ) M.J. Roberts, Fundamentals of Signals and Systems 34
Cycles in N0 samples q F0 = N0 the number of cycles in N0 samples the smallest integer : fundamental period F0 N 0 = q 2 π F0 N 0 = 2 π q q cycles in N0 samples M.J. Roberts, Fundamentals of Signals and Systems 35
Cycles in T0 time duration and N0 samples g (t ) = 4 cos 2 π (t + T 0 ) ( f0= ) = T0 g[n] = 4 cos 2 π (n + N 0 ) ( F0 = T0 = q = N0 Fundamental Period of g(t ) q= cycle in T0=/ time interval ) Fundamental Period of g [n] N 0 = q= cycles in N0= samples N0 F0 N0 = q F0 M.J. Roberts, Fundamentals of Signals and Systems
Difficult to recognize a discrete-time sinusoid 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. F '0 = = N0 M.J. Roberts, Fundamentals of Signals and Systems 37
Periodic Condition Examples 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); g [n] = 4 cos 2 π n ) cycles in N0= samples 2 g [n] = 4 cos 2 π n ) 2 cycles in N0= samples 3 g [n] = 4 cos 2 π n ) 3 cycles in N0= samples g [n] = 4 cos 2 π n ) cycles in N0= samples ( ( ( ( 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 38
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 39
The same digital sequences g (t ) = A cos(2 π f 0 t +θ) k f 0 n T s g [n] = A cos(2 π F 0 n + θ) k f 0 n T s = f 0 n T s = 2 f 0 n T s 2 = 3 f 0 n T s 3 M.J. Roberts, Fundamentals of Signals and Systems 40
The same digital sequence 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 = T2 = T3 = 0 20 30 n = 0,, 2, 3, n = 0,, 2, 3, n = 0,, 2, 3, g [n] = A cos(2 π F 0 n + θ) t n T t nt2 t nt3 g [n] = 4 cos ( 2 π nt ) g2 [n ] = 4 cos ( 2 π 2 nt 2 ) g3 [n] = 4 cos ( 2 π 3 n T 3 ) n T = 0, 0., 0.2, 0.3, = t 2 n T 2 = 0, 0., 0.2, 0.3, = 2 t 3 n T 3 = 0, 0., 0.2, 0.3, = 3 t { g [n] } { g2 [n ] } { g2 [n] } M.J. Roberts, Fundamentals of Signals and Systems 4
f0nts = const T = T2 = T3 = 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
The same sampled sequences cos ( ω t ) = cos ( ω n T ) ω n T = ω 2 n 2 T 2 + 2 k π cos ( ω2 t 2 ) = cos ( ω 2 n 2 T 2 ) cos ( ω t ) = cos ( ω n T ) ω n T = ω 2 n 2 T 2 cos ( ω2 t 2 ) = cos ( ω 2 n 2 T 2 ) 43
Three special cases cos ( ω t ) = cos ( ω n T ) ω n T = ω 2 n 2 T 2 cos ( ω2 t 2 ) = cos ( ω 2 n 2 T 2 ) constant n ω nt = ω2 n T 2 ω T = ω2 T 2 constant ω ω n T = ω n2 T 2 n T = n2 T 2 constant T ω n T = ω2 n 2 T ω n = ω 2 n2 44
f0ts = const, nts = const ω T = ω2 T 2 constant n n T = n2 T 2 constant ω 2T 2 T ω ω 2 n2 n2 ω 2 ω 2T T2 45
f0ts = const, nts = const ω n = ω 2 n2 T constant T 3 n 2 ω 3 n 2 n2 3 ω T 46
f0ts = const, nts = const ω T = ω2 T 2 n T = n2 T 2 T 2T 2 ω ω 2 n2 constant n n2 constant ω ω 2 ω T2 ω n = ω 2 n2 47 2T
f0ts = const, nts = const T ω 3 n 2 constant T n2 3 ω T 48
Periodic Condition Examples cos ( ω t ) = cos ( ω n T ) cos ( ω n T ) ω t = ω2 t 2 ω t = ω t2 ω nt = ω2 n T 2 ω n T = ω n2 T 2 constant n constant ω ω (2 T 2 ) = (2 ω )T 2 (2 n2 )T = n2 (2 T ) cos ( ω2 t 2 ) = cos ( ω 2 n T 2 ) cos ( ω n2 T 2 ) 49
Periodic Condition Examples ω nt = ω2 n T 2 ω n T = ω n2 T 2 constant n constant ω ω T s n T s ω T s n T s 50
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 5
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 52