Digital Signal Processing Reference
In-Depth Information
64 / 34 = 1 . 882 which of course implies that aliasing will occur. The result from decimating a one cycle,
64-sample cosine by a factor of 34 is shown in Fig. 3.37, plots (e) and (f ).
3.17.3 CONSTANT SR, NON-INTEGRAL DECIMATION
By removing the restriction that D be an integer in Eq. (3.4), it is possible to achieve any output frequency
within the allowed range of output frequencies.
For example, let D equal a noninteger such as 2.5. Then we would have
32000
·
2 . 5
·
1
F Out =
=
2500 Hz
32
The problem with nonintegral decimation is that there are no ROM addresses other than the
integers from 1 to N , the length of the ROM. For a decimation factor of 2.5, for example, we would have
to read out ROM Address 1 (which exists), Address 3.5 (which doesn't exist), Address 6 (which exists),
Address 8.5 (which doesn't exist), etc.
We can, however, simply compute a value for the sinusoid had the ROM Address existed, using an
interpolation method, such as simple linear interpolation, the accuracy of which increases as the number
of samples per cycle in the ROM increases, or a more sophisticated interpolation scheme using three or
more contiguous existing values in the ROM.
For linear interpolation, the following formula applies:
y(x 1 +
=
+
·
y(x 1 )) (3.5)
where x 1 and x 2 are adjacent integral ROM addresses, and x lies between 0 and 1, and y is the ROM's
actual or imputed value at integral or nonintegral addresses, respectively.
x)
y(x 1 )
(x)
(y(x 2 )
Example 3.30. Set up Eq. (3.5) to determine the value of a 32-sample sine wave at nonintegral sample
number 3.2 (samples being numbered 1 to 32).
Using Eq. (3.5), the value we would use for ROM Address 3.2, y( 3 . 2 ) , would be
y( 3 ))
To explore this using Command Line calls, make the following call:
y( 3 . 2 )
=
y( 3 )
+
0 . 2
·
(y( 4 )
y = sin(2*pi*( 0:1:31) / 32 ); y3pt2 = y(3) + (0.2)*(y(4) - y(3))
The above call yields y3pt2 = 0.4173. To see what the sine value would be using MathScript, make
this call:
alty3pt2 = sin(2*pi*2.2 / 32)
which yields alty3pt2 = 0.4187 (note that the third sample of y is for t = 2 / 32, since the time vector
starts at 0/32, not 1/32).
For a closer approximation using linear interpolation for a sine, start with a longer sine. For example,
computing sample 3.2 for a length 512 sine make the following calls:
y = sin(2*pi*(0:1:511) / 512); y3pt2 = y(3) + (0.2)*(y(4)-y(3))
and
Search WWH ::




Custom Search