$30
In discrete‐time signal processing, it is often necessary to convert a signal from one sampling rate to another. A common example is the conversion from the sampling rate of a compact disk (CD); signal (44.1 KHz) to that of a Digital Audio Tape (DAT) signal (48 KHz). Another example is the aud io standard in High‐Definition Television (HDTV) transmission, where at least three sampling rates are supported (32, 44.1, and 48 KHz). Although in principle we may convert the signal back to analog form and resample at the desired rate, it is usually preferable to perform t he entire conversion digitally. This is clue to many considerations including the fact that conversion to analog form often introduces noise in the signal, and that digital signal processing can be much more cost‐effective and flexible.
This MATLAB project asks you to perform a sampling rate conversion on segments of audio signals. The input audio signals are quantized to 8 bits and sampled with a sampling frequency of 11,025 Hz. You are required to convert the signal to a sampling rate of 24,000 Hz in a computationally efficient manner. Although one conceptual way of realizing this sampling rate conversion process is to upsample the signal, lowpass filter, and downsample it, a more clever implementation can lead to an implementation that is many times more efficient. To do this, you can exploit various aspects of class to optimize the system, such as multistage filter implementation, filter design, and polyphase implementation. By the end of the project, you hopefully will have a much better understanding of both the theoretical aspect of the system as well as various issues in implementing a practical DSP system at a software level.
Project Goal
L
A sampling rate converter which produces an output signal with a sampling rate which is times the
M
original sampling rate can be specified as shown in Figure 1.
Figure 1: Sampling rate conversion system.
For an ideal sampling rate converter, the lowpass filter in Figure 1 is an ideal lowpass filter with cutoff
⎛π π⎞ frequency ωc = min⎜ , ⎟ The goal of this project is to design an efficient DSP algorithm that
⎝M L⎠
implements the system in Figure 1 subject to the following constraints:
• The system performs the correct sampling rate conversion from 11,025 Hz to 24,000 Hz. In particular, do not assume that 11,025 Hz ≈ 11,000 Hz.
If the system in Figure 1 is an ideal sampling rate converter , when the input x[n] is a unit impulse δ[ ]n , the output y[n] has a Fourier transform Y e( jω) which corresponds to an ideal lowpass filter with
a cutoff frequency at ωc = (11,025/ 24,000)π. For an equivalent system which you are to implement, when the input x[n] is a unit impulseδ[ ]n , the output y[n] must have a Fourier transform Y e( jω) which is an approximation of a lowpass filter, and meets the specifications shown below in Table 1.
Passband Cutoff (ωp)
Passband Ripple
±0.1 dB or less
Stopband Frequency (ωs)
1.2ωp
Stopband Attenuation
70 dB or more
Phase Constraints
|max grpdelay ‐ min grpdelay| ≤ 720 in the passband
Table 1
If your sampling rate conversion system functions properly, you should meet the specifications in Table 1, and when you play the output audio signal at 24,000 Hz, it should sound the same as the input audio signal played at 11,025 Hz.
You should get a rough estimate of the efficiency of your design by determining how much computation was required to perform the sampling rate conversion on the Wagner.wav signal. The method which you will use to count the number of operations will be described shortly.
You are to write a MATLAB function srconvert such that the command srconvert(in) takes the input signal in with an associated sampling rate of 11,025 Hz, and returns an output signal at a sampling rate of 24,000 Hz. (See the section on writing MATLAB functions.) Once your function
srconvert.m is finalized, run the command y=srconvert([1 zeros(1,3000)]);. This will produce a vector y which contains the response of your system to a unit impulse. Then call verify(y) to verify that your design meets the design specification.
Appendix – An Old Homework Problem:
Let x[ ]n represent a signal which is obtained by sampling a continuous time audio signal xc ( )t using an ideal C/D
converter shown in Figure A1. Assume that the sampling rate is 1/T= 44.1 kHz .
T
Figure A1
We wish to design a 4x (4 times) oversampling digital FIR interpolation filter. One way to do this is to use the single‐stage design of System 1 shown in Figure A2.
x[ ]n
Figure A2: System 1
The filter hn[ ] with Fourier transform H e( jω) is designed using the window method with a Kaiser window.
Suppose the filter hn[ ] is designed to meet Specification 1:
Specification 1:
1−δ≤ H e( jω) ≤ +1 δ ω ω, ≤ 1
H e( jω) ≤δ, ω ω2 ≤ ≤π
where ω1 = 0.23π, ω2 = 0.27π, and δ=10−4 .
(a) Using a Kaiser window, estimate the length of the filter hn[ ] which meets Specification 1.
(b) Using the filter length estimate for h n[ ] in part(a), estimate the number of multiplications per second
required in System 1 if the system is implemented in polyphase form using four polyphase components.
An alternate way to design the 4x oversampling interpolation filter is to use the two‐stage design of System 2 shown in Figure A3.
Stage 1 Stage 2
Figure A3: System 2
The filters h n1[ ]and h n2[ ] with frequency responses H e1( jω) and H e2( jω) , respectively, are designed using the window method with Kaiser windows. Suppose that these filters are designed to meet Specification 2.
Specification 2:
1−δ′ ≤ H e1( jω) ≤ +1 δ ω′, ≤ 2ω1
H e1( jω) ≤δ′, 2ω ω π2 ≤ ≤
1−δ′ ≤ H e2( jω) ≤ +1 δ′, ω ≤ω1 H e2( jω) ≤δ′, π ω ω π− 1 ≤ ≤
where δ′ = 1+δ−1,ω1 , ω2 , and δare given previously.
(c) Show that System 2 is equivalent to System 1 with
H e( jω)=H e H e1( jω) 2( jω)
(d) Show that if the filters h n1[ ]and h2[ ]n are designed using Kaiser windows to meet Specification 2, then the resulting equivalent system in System 1 will have a filter H e( jω) which meets Specification 1. (You may assume that the filters designed have magnitude responses which are monotonically decreasing in the transition band from the passband to the stopband).
(e) Using Kaiser windows, estimate the lengths of the filters h n1[ ]and h2[ ]n which meet Specification 2.
(f) Using the filter length estimates for h n1[ ]and h n2[ ]in part (e), estimate the number of multiplications per second required in System 2 if each stage is separately implemented in polyphase form using two polyphase components. What are the computational savings in multiplications, if any, over System 1?