MATLAB Example – Simulating the Speech Scrambler

Now recall that to scramble the speech we need to

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e command length(xL) returns the number of points in xL – that is, 200000 points. An efficient algorithm for computing the DFT (called a Fast Fourier Transform (FFT)) exists for DFT lengths that are powers of 2. As we know, the DFT length must be greater than or equal to that of the signal. So, we set the DFT length to be the smallest power of 2 that is at least as big as the signal length – in this case, 218 = 262144 points. Use the command XL=fft(xL,2^18); N Recall that DFT samples k = 0, ..., (where N is the DFT length) represent positive 2 frequencies, and that in that range the kth DFT sample represents CT frequency k/(NTS) Hz. Also, although DFT indexing starts with k = 0, MATLAB always starts indexing vectors at 1 N (so, the range k = 0, ..., = 0, ..., 217 corresponds to MATLAB component range 1,…,217+1). 2 So, to plot the positive frequency part of the DFT vs. CT frequency f, we can use the commands k=[0:1:2^17]; f=2^(- 18)*fs*k; plot(f,abs(XL(1:2^17+1); axis([0,6000,0,2500]) %plots out to 6 kHz on the frequency axis xlabel(‘f’) ylabel(‘frequency content of speech signal’) print –dpng fig_1 %saves plot as file fig_1.png in MATLAB working folder The saved plot fig_1 is shown below. Now recall that to scramble the speech,...
View Full Document

This test prep was uploaded on 03/06/2014 for the course ECE 563 taught by Professor Goeckel during the Fall '11 term at UMass (Amherst).

Ask a homework question - tutors are online