DOC PREVIEW
MIT 2 161 - Problem Set 8- FIR Linear Filters

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MIT OpenCourseWare http://ocw.mit.edu 2.161 Signal Processing: Continuous and Discrete Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.| F (j W) |0| F ( j ( W - W ) ) |s c r a m b l e rWWaWas c r a m b l e d s p e e c ho r i g i n a l s p e e c h0WA1W - WAa1MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING 2.161 Signal Processing - Continuous and Discrete Fall Term 2008 Problem Set 8: FIR Linear Filters Assigned: November 6, 2008 Due: November 18, 2008 Problem 1: A Mini-project: An Audio Scrambler Hint: We looked at this problem in Quiz 1. Look at the published solution. Text-messaging is out-of-date! You and I have been communicating by sending voice-messages to each other as “.wav” files. It’s not that I am paranoid, but everybody is out to get me! In particular, “they” have been intercepting all of our voice messages. But we are going to outwit “them” by using MATLAB to scramble our voice messages before sending them, making them unintelligible using a secret encoding scheme, and then we will descrambling the messages when we get them. your task is to design and implement the speech encoder and decoder. the requirement is that the scrambled message should occupy the same audio bandwidth (approximately 300 – 3000 Hz) as the original message, and the descrambled message should have good fidelity. We will use a frequency domain “mirroring” scheme, where the frequency components are flipped, so that high frequencies are translated to low frequencies and vice-versa. A spectral com-ponent with frequency Ω1 will be translated to a new frequency Ωa − Ω1, where Ωa is known to the sender and recipient. The resulting waveform is unintelligible until the frequency relationships have been restored. The scheme is shown below: Thus, a spectrum as shown on the left will be translated to that shown on the right. The decoder will restore the correct frequency relationships. Consider a component A sin(Ωt), we want to translate it to A sin ((Ωa − Ω) t). From elementary trigonometry A sin ((Ωa − Ω) t) = A (sin(Ωat) cos(Ωt) − cos(Ωat) sin(Ωt)) = A sin(Ωat) sin(Ωt + π/2) − A sin(Ωat + π/2) sin(Ωt) which leads to the following time-domain processing to shift a single frequency component.H i l b e r t t r a n s f o r m e rXXSf ( t )s i n (W t )a-+c o s (W t )ag ( t )9 0 p h a s e s h i f t e ro9 0 p h a s e s h i f t e roXXSA s i n ( W t )s i n ( W t )aA s i n ( ( W - W ) t )a-+A π/2 phase-shifter is easy to build for a single frequency, such as sin(Ωat) but when the input signal, such as a speech signal, contains more than just a single component each spectral component must be shifted by 90◦. This requires an all-pass filter with a constant phase shift, which is a difficult design task for a continuous filter. Approximations as active or passive filters are available. The Hilbert transformer is an all-pass filter with a transfer function H(jΩ) = � j Ω > 0 −j Ω < 0, which is exactly what we want. The following shows the scrambler implemented with a Hilbert transformer Then G(jΩ) = F (j(Ωa − Ω). (a) Practical implementations of Hilbert transformers are approximations. For example, suppose an implementation has ripple in its passband so that at a particular frequency Ωo the transfer function is |H(jΩo)| = 1 + πδ � H(jΩo) = − 2 where δ is a perturbation from the ideal response. Find the output g(t) when the input is f(t) = A sin(Ωot). Have any “spurious” spectral components been introduced? (You can do this with simple trigonometric identities.) (b) Your task is to design, implement, and test an audio scrambler and descrambler using this encoding technique: You should write a pair of MATLAB functions as follows: •H i l b e r t t r a n s f o r m e rXXSf ( t )s i n (W t )a-+c o s (W t )ag ( t )l e n g t h N ( o d d )d e l a y ( N - 1 ) / 2y_scramble = encode(f_audio, Fs, Fa) y_descramble = decode(y_scramble, Fs, Fa) where f audio is a MATLAB array containing the audio file to be processed, Fs is the sampling frequency (Hz) of the data in f audio, and Fa is the frequency (Hz) around which the spectrum is reflected. The first function should take encode the file, the second restore the scrambled version to the original. We will supply you with two audio files (.wav) that you can download and use. One• is an ordinary audio file (PS8Raw.wav) that is to be to be scrambled and descrambled. The second is one that we have already scrambled (PS8Scrambled.wav). These may be imported into your MATLAB workspace using the wavread() function [f_audio,Fs,Nbits] = wavread(’myfile’) see the MATLAB help. You should use the Parks-McClellan design function firpm() to design a Hilbert trans- • former that covers the frequency span 300 – 3000 Hz. (The help on firpm() has an example) Be aware that the quality of you scrambling will be affected by the pass-band ripple that you allow. Don’t forget that the FIR Hilbert transformer is a causal linear-phase system, and that • it MUST have an odd length impulse response. You will need to add an equivalent delay filter in the other arm. Design an appropriate FIR impulse response. The audio arrays will be large. Use fftfilt() to do the actual filtering operations. • Let’s standardize on a reflection frequency Fa = 3500 Hz. • To test your scrambler, load the audio file, then compute and plot its magnitude spec-• trum. Then scramble the file and plot its magnitude spectrum. Make sure it is what you expect. If there are any spurious components, try to find why they are there, and fix them. You should submit the following: (a) Listings of your two functions. (b) Details of your Hilbert transformer design, including plots of the pass-band ripple, and details of the phase response. (c) A summary of your approach, including the compromises you made in any design choices. (d) Plots of the magnitude spectra of 1. The audio file in PS8Raw.wav. 2. Your scrambled version of PS8Raw.wav.3. The result of descrambling your scrambled version of PS8Raw.wav. Use fftshift() on the spectra to make them more readable. (e) You should upload three .wav files to the 2.161 MIT Server site in the homework


View Full Document
Download Problem Set 8- FIR Linear Filters
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Problem Set 8- FIR Linear Filters and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Problem Set 8- FIR Linear Filters 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?