Digital Signal Processing Reference
In-Depth Information
N=1980; n = 0:1:N;y=0;fork=1:1:99;
y=y+(1/k)*sin(2*pi*10*k*n/N); end; figure; plot(y)
The script
LV SynthP lotSquareSawtooth(W aveT ype, F undF req, SR)
will synthesize square, sawtooth, and triangle waves one harmonic at a time (press any key for the next
harmonic after making the initial call); specify WaveType as 1 for sawtooth, 2 for square, or 3 for triangle.
The following call results in Fig. 2.8, which shows the synthesis of a 10-cycle square wave up to the first
three harmonics (harmonics 1, 3, and 5).
LVSynthPlotSquareSawtooth(2,10,1000)
1
0.5
0
−0.5
−1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
(a) Component Waves (X−axis = time, sec): Press Any Key to Continue
1
0.5
0
−0.5
−1
0
0.2
0.4
0.6
0.8
(b) Sum of All Components to Harmonic 5; X−axis = time, sec
Figure 2.8: (a) The first three weighted harmonics of a square wave; (b) Superposition of the waves
shown in (a).
2.4.8 FOLDED SEQUENCE
From time to time it is necessary to reverse a sequence in time, i.e., assuming that x [ n ]
= [1,2,3,4], the
folded sequence would be x
[−
n
]
. The operation is essentially to flip the sequence from left to right around
 
Search WWH ::




Custom Search