Digital Signal Processing Reference
In-Depth Information
Input factor M, data length N, data d
Import low pass filter h, with cut-off F c = 1/M
y out,k = 0 ( k = 1,2,…, MN )
If ( L +1 > 10 M )
{ filter length L +1 should be > 10
×
M }
for k = 1 to N
y out, [ M ( k - 1) + 1] = d k
end
y out = M
y out = M
×
×
filter( h , y out )
filter( h , y out )
{ filter data d with h and scale by M }
{ filter data d with h and scale by M }
end
Figure 2.28 Pseudocode to implement interpolation by factor M .
no greater than 1/ M . Finally, the filter output is gained up by factor M . The latter
operation results in the interpolation of the values where the zeros have been
placed. This simple approach could be implemented as shown in Figure 2.27.
Moreover, if the interpolation factor is 2, then the compact half-band algorithm
given in Section 2.8 could be used to implement the filtering operation.
no greater than 1/ M . Finally, the filter output is gained up by factor M . The latter
operation results in the interpolation of the values where the zeros have been
placed. This simple approach could be implemented as shown in Figure 2.27.
Moreover, if the interpolation factor is 2, then the compact half-band algorithm
given in Section 2.8 could be used to implement the filtering operation.
Note that for successful signal interpolation, the filter length should be at least
ten times greater than the interpolation (or rate change) factor, M . This allows the
filter to effectively use existing data to introduce the sampling rate change. High-
frequency oscillations would be observed if the filter length is comparable to the
rate change factor.
Note that for successful signal interpolation, the filter length should be at least
ten times greater than the interpolation (or rate change) factor, M . This allows the
filter to effectively use existing data to introduce the sampling rate change. High-
frequency oscillations would be observed if the filter length is comparable to the
rate change factor.
There are several functions in Matlab
that implement one or another version
of sampling rate change. For example, interp is identical to the algorithm given in
Figure 2.28, however interp1 and spline are also available. The function interpft
implements interpolation via the FFT algorithm.
that implement one or another version
of sampling rate change. For example, interp is identical to the algorithm given in
Figure 2.28, however interp1 and spline are also available. The function interpft
implements interpolation via the FFT algorithm.
There are several functions in Matlab
2.9.2 Sampling Rate Change by Factor P/ M
In some applications, we are required to change the sampling rate by a fraction
M / P . The best way to do this is to implement a rate change increase by M
followed by decimation by P . We recall that in decimation the filtering operation
is carried out before removal of the unwanted samples, whereas in interpolation,
the filtering is carried out after zero insertion. These two functions could be
carried out in a single operation by choosing a low-pass filter with cut-off F c such
that
1
1
F c
=
min
,
(2.33)
M
P
Low-Pass Filter
Cut-off, F c
x t
M
x
P
P
t
M
Figure 2.29 Scheme for sampling rate change of M/P .
 
 
Search WWH ::




Custom Search