Documente Academic
Documente Profesional
Documente Cultură
Theory:
There exists different techniques to generate a sine wave on a DSP processor.
Using a lookup table, interpolation, polynomials, or pulse width modulation are some of these
techniques utilized to generate a sine wave. When a slightly sufficient processing power is
considered, it is possible to utilize another technique which makes use of an IIR filter.
In this technique, a second order IIR filter as shown in Figure 1 is designed to be marginally
stable which is an undesirable situation for a normal filtering operation. For this second order
filter to be marginally stable, its poles are located in the unit circle. After choosing the suitable
filter oefficients for the filter to be marginally stable, a unit impulse is applied to the filter as an
input at time t = 0, and then the input is disconnected. Then the filter starts to oscillate with a
fixed frequency.
The difference equation of the second order filter shown in Figure 1 will be:
Where F0 is the frequency, Fs is the sampling frequency and A is the amplitude of the
sine wave.
Y[n]=-a1y[n-1]-a2y[n-2]+b0[n]
Where, y[n-1]=y[-2]=0
a1=-2 ( ), a2=1,
b0=A Sin(w0),
w0 = 2/s
Program:
Result:
Sinusoidal waveform is generated using IIR filter method