260 likes | 427 Views
“Alien Voices". Texas Instruments University Programme Teaching Materials. Alien Voices. Objectives. To generate “alien voices” using ring modulation. To implement ring modulation in C code.
E N D
“Alien Voices" Texas Instruments University Programme Teaching Materials
Objectives • To generate “alien voices” using ring modulation. • To implement ring modulation in C code. • To speak into the microphone connected to the Texas Instruments TMS320C5505 USB Stick and hear the results on headphones/computer loudspeakers.
Introduction • In many science fiction films and TV series, when an alien speaks it is given a very strange voice. • This is normally achieved using what is known as “ring modulation”. • This is one of the simplest forms of DSP processing and is fun to experiment with. • Click on the icon below to hear the effect.
Ring Modulation Block Diagram • Multiply audio input by a sine wave.
Cosine Identities • The following identities exist to add or subtract cosines:
Equation for Ring Modulation • To implement ring modulation, multiply together two sinusoidal waveforms cosA and cosB.
Sum and Difference Frequencies • The output of ring modulation consists of: • Sum of two frequencies: • ½cos(A+B). • Difference between the two frequencies: • ½cos(A-B). • Note: there is no cosA or cosB term at the output.
Ring Modulation 50Hz and 500 Hz • The output contains 450 Hz and 550 Hz.
Applications of Modulation • Modulation is used in radio transmissions. • In the case of radio, the modulating frequency can be in kHz to GHz. • Ring modulation is similar to AM radio. • In radio transmissions, the sum and difference frequencies are referred to as sidebands.
C Code Implementation • To generate the sine waves, the C code uses the sine function in DSPLIB • The multiplication of the audio input by the sine wave is performed in the function ring_modulation().
Practical Alien Voices • In the Laboratory you will build a C code implementation of alien voices • When you speak into the microphone you hear different ring modulation effects from the TMS320C5505 USB Stick.
USB Stick Setup TMS320C5505 USB to PC Microphone Headphones
Installing the Application • Use the code given in Application 8 Alien Voices • Follow the steps previously given in Chapter 1 to set up the new project.
Change Modulation Frequencies • Change the frequency for each channel: 200Hz 500Hz
Improving the Effect • To make the speech more intelligible, change amount of un-modulated input. Try mono_input/2
Programming Challenge • The alien voices effect can be further modified using reverberation • Add some reverberation by copying the files reverberation.c and reverberation.h from the Application 3 Echo and Reverberation • Add the following to main.c: • #include “reverberation.h” • right_output = reverberation (left_output + mono_input/4);
Questions • What is ring modulation? • Why does ring modulation produce sum and difference frequencies? • What happens if you apply ring modulation to music?