<< Chapter < Page Chapter >> Page >

After you have made the changes to all eight coefficients, run your new filter and use the oscilloscope to measure thedelay between the raw (input) and filtered (delayed) waveforms.

What happens to the output if you change either the scaling factor or the delay value? How many seconds long is asix-sample delay?

Step 9: test-vector simulation

As a final exercise, you will find the output of the DSP for an input specified by a test vector. Then you will comparethat output with the output of a MATLAB simulation of the same filter processing the same input; if the DSPimplementation is correct, the two outputs should be almost identical. To do this, you will generate a waveform inMATLAB and save it as a test vector. You will then run your DSP filter using the test vector as input and import theresults back into MATLAB for comparison with a MATLAB simulation of the filter.

The first step in using test vectors is to generate an appropriate input signal. One way to do this is to use theMATLAB function to generate a sinusoid that sweeps across a range of frequencies. The MATLAB function save_test_vector (available as save_test_vector.m can then save the sinusoidal sweep to a file you will later includein the DSP code.

Generate a sinusoidal sweep and save it to a DSP test-vector file using the following MATLAB commands:

>>t=sweep(0.1*pi,0.9*pi,0.25,500); % Generate a frequency sweep>>save_test_vector('testvect.asm',t); % Save the test vector

Next, use the MATLAB conv command to generate a simulated response by filtering the sweep with the filter h you generated using gen_filt above. Note that this operation will yield a vector of length 507 (which is n m 1 , where n is the length of the filter and m is the length of the input). You should keep only the first 500 elements of the resulting vector.

>>out=conv(h,t) % Filter t with FIR filter h>>out=out(1:500) % Keep first 500 elements of out

Now, modify the file filter.asm to use the alternative "test vector" core file, vectcore.asm . Rather than accepting input from the A/D converters and sending outputto the D/A, this core file takes its input from, and saves its output to, memory on the DSP. The test vector is storedin a block of memory on the DSP evaluation board that will not interfere with your program code or data.

The test vector is stored in the ".etext" section. See Core File: Introduction to Six-Channel Board for TI EVM320C54 for more information on the DSP memory sections, including a memory map.
The memory block that holds the test vector is large enough to hold a vector up to 4,000 elementslong. The test vector stores data for both channels of input and from all six channels of output.

To run your program with test vectors, you will need to modify filter.asm . The assembly source is simply a text file and can be edited using the editor ofyour preference, including WordPad, Emacs, and VI. Replace the first line of the file with two lines. Instead of:

Questions & Answers

A golfer on a fairway is 70 m away from the green, which sits below the level of the fairway by 20 m. If the golfer hits the ball at an angle of 40° with an initial speed of 20 m/s, how close to the green does she come?
Aislinn Reply
cm
tijani
what is titration
John Reply
what is physics
Siyaka Reply
A mouse of mass 200 g falls 100 m down a vertical mine shaft and lands at the bottom with a speed of 8.0 m/s. During its fall, how much work is done on the mouse by air resistance
Jude Reply
Can you compute that for me. Ty
Jude
what is the dimension formula of energy?
David Reply
what is viscosity?
David
what is inorganic
emma Reply
what is chemistry
Youesf Reply
what is inorganic
emma
Chemistry is a branch of science that deals with the study of matter,it composition,it structure and the changes it undergoes
Adjei
please, I'm a physics student and I need help in physics
Adjanou
chemistry could also be understood like the sexual attraction/repulsion of the male and female elements. the reaction varies depending on the energy differences of each given gender. + masculine -female.
Pedro
A ball is thrown straight up.it passes a 2.0m high window 7.50 m off the ground on it path up and takes 1.30 s to go past the window.what was the ball initial velocity
Krampah Reply
2. A sled plus passenger with total mass 50 kg is pulled 20 m across the snow (0.20) at constant velocity by a force directed 25° above the horizontal. Calculate (a) the work of the applied force, (b) the work of friction, and (c) the total work.
Sahid Reply
you have been hired as an espert witness in a court case involving an automobile accident. the accident involved car A of mass 1500kg which crashed into stationary car B of mass 1100kg. the driver of car A applied his brakes 15 m before he skidded and crashed into car B. after the collision, car A s
Samuel Reply
can someone explain to me, an ignorant high school student, why the trend of the graph doesn't follow the fact that the higher frequency a sound wave is, the more power it is, hence, making me think the phons output would follow this general trend?
Joseph Reply
Nevermind i just realied that the graph is the phons output for a person with normal hearing and not just the phons output of the sound waves power, I should read the entire thing next time
Joseph
Follow up question, does anyone know where I can find a graph that accuretly depicts the actual relative "power" output of sound over its frequency instead of just humans hearing
Joseph
"Generation of electrical energy from sound energy | IEEE Conference Publication | IEEE Xplore" ***ieeexplore.ieee.org/document/7150687?reload=true
Ryan
what's motion
Maurice Reply
what are the types of wave
Maurice
answer
Magreth
progressive wave
Magreth
hello friend how are you
Muhammad Reply
fine, how about you?
Mohammed
hi
Mujahid
A string is 3.00 m long with a mass of 5.00 g. The string is held taut with a tension of 500.00 N applied to the string. A pulse is sent down the string. How long does it take the pulse to travel the 3.00 m of the string?
yasuo Reply
Who can show me the full solution in this problem?
Reofrir Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ece 320 spring 2004. OpenStax CNX. Aug 24, 2004 Download for free at http://cnx.org/content/col10225/1.12
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 320 spring 2004' conversation and receive update notifications?

Ask