The purpose of this assignment is for you to learn about sound waveforms and how
ID: 3654321 • Letter: T
Question
The purpose of this assignment is for you to learn about sound waveforms and how to process them, which is known as digital signal processing (DSP). Your program will read a sound waveform from a file, encoded in the .wav format, process it, and write the result to a new file. You will write two DSP methods for low-pass filtering and echoing. Apply a low-pass filtering algorithm to the waveform. You should try various amounts of filtering (20, 40, 80, and 160 samples) and listen to the results. Save one of the results to an output .wav file. Add an echo to the sound waveform. Try delays of 500, 1000, and 2000 samples. Save one of the results to an output .wav file. Details Create a project in Eclipse for this assignment. Download this zipped file SoundStuff.zip and unzip its 8 .java files into the src folder that Eclipse created for your project. Unzip its 4 .gif files into the bin folder that Eclipse created. (In eclipse, you will see all of these files inside the folder "(default package)"). Next, download the class Example.java and also store it in the src folder of your project. Look at the code and try to understand how it works, so that you will be able to modify it for your own purposes. A low-pass filtered version of the sound can be created by replacing each sample by the average of its neighboring samples. I suggest you try 20 samples first. Specifically, have your program create a new Sound object having the same length as the original one and set each sample sound2.setSampleAt(n, avgValue) to be (sound1.getSample(n) + sound1.getSample(n+1) + ... + sound1.getSample(n+19) )/20. Save the processed Sound object 'sound2' by the line of code: sound2.write("FilteredSound.wav"); By using an average, the waveform is smoothed out, which removes the highest frequencies. The lowest frequencies are unchanged, i.e., the filter passes the low frequencies and removes the high ones. You shold be able to hear the difference. Here is a bit of a song by the German singer Nena on which you can test your algorithm "Tokyo" by Nena. Here is a stereo version that sounds better, but only one channel will be affected by the code in Example.java and it is difficult to hear the changes. To use these music files without having to include folder information in your code, save them in the folder having the name of your project (not in its src subfolder). To create an echo effect, add a delayed version of the sound to itself. Try a delay of 500 samples first. Assume the echo is half as loud as the original. Specifically, create a new Sound object with length that is 500 samples shorter than the original Sound object. The value of the nth sample of the new Sound object is (sound1.getSample(n)/2.0 + sound1.getSample(n+500))/1.5 http://www.cse.sc.edu/~carrollh/CSCE145/files/SoundStuff.zip http://www.cse.sc.edu/~carrollh/CSCE145/lib/Example.javaExplanation / Answer
Digital signal processing (DSP) is the mathematical manipulation of an information signal to modify or improve it in some way. It is characterized by the representation of discrete time, discrete frequency, or other discrete domain signals by a sequence of numbers or symbols and the processing of these signals. Digital signal processing and analog signal processing are subfields of signal processing. DSP includes subfields like: audio and speech signal processing, sonar and radar signal processing, sensor array processing, spectral estimation, statistical signal processing, digital image processing, signal processing for communications, control of systems, biomedical signal processing, seismic data processing, etc. The goal of DSP is usually to measure, filter and/or compress continuous real-world analog signals. The first step is usually to convert the signal from an analog to a digital form, by sampling and then digitizing it using an analog-to-digital converter (ADC), which turns the analog signal into a stream of numbers. However, often, the required output signal is another analog output signal, which requires a digital-to-analog converter (DAC). Even if this process is more complex than analog processing and has a discrete value range, the application of computational power to digital signal processing allows for many advantages over analog processing in many applications, such as error detection and correction in transmission as well as data compression.[1] DSP algorithms have long been run on standard computers, on specialized processors called digital signal processor on purpose-built hardware such as application-specific integrated circuit (ASICs). Today there are additional technologies used for digital signal processing including more powerful general purpose microprocessors, field-programmable gate arrays (FPGAs), digital signal controllers (mostly for industrial apps such as motor control), and stream processors, among others.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.