ECE-GY 6183: Digital Signal Processing Lab - DSP Lab Exam, Fall 2022
DSP Lab Exam, Fall 2022
ECE-GY 6183, ECE-UY 4163
- Sign and submit the attached ‘oath’ along with your solutions.
- You may use the course resources (lecture videos, demo programs, textbook, etc) and your own prior work for this course.
- You may ask me (Ivan Selesnick) if you have questions about the exam. But you may not discuss the exam with anyone else. You may not get help from anyone. You may not ask anyone for assistance. Your submitted work must be 100% your own effort.
- You may consult the web for information (e.g., python documentation) but not for how to solve the problems below.
To submit: For each question, provide:
- Programs files. Ensure that your submitted program files run on their own (without additional files needed) so that we can run your file.
- Short written explanation about your approach and comments.
- Provide a short video (screen recording, not more than 30 seconds) demonstrating your program.
Question 1: Siren with real-time graphical interface
Using Python and TKinter, implement a graphical user interface (GUI) that generates the sound of a siren (e.g., a police car siren or an ambulance siren). The siren sound will have a frequency that periodically increases and decreases. For example, the increasing and decreasing function could be a periodic triangle wave, a sinusoidal wave, or the frequency could just alternate between high and low frequencies. Your GUI should allow the user to select from at least two such frequency templates. It should also have sliders for the user to vary the maximum and minimum frequencies of the siren sound. Your GUI should also have a slider for the time it takes for the siren sound to repeat (the time for the siren frequency to rise and fall one time). The user should be able to hear the e↵ect as the sliders are moved with negligible latency. Audible artifacts when sliders are moved should be avoided. The GUI should run until a ‘quit’ button is pressed. The output audio signal should be saved to a wave file.
Youtube videos of example siren sounds: https://www.youtube.com/watch?v=r8VdWLIAzr0 https://www.youtube.com/watch?v=BUavJxsRl6U
Figure 1 and Figure 3 in this paper shows examples of the frequency as a periodic function. https://www. researchgate.net/publication/26546424_A_Siren_Detection_System_based_on_MechanicalResonant Filters/figures?lo=1&utm_source=google&utm_medium=organic
In addition to the materials listed above, submit a wave file of the output signal. In your screen recording, show the adjustment of the sound using your GUI.
Question 2: Real-time frequency spectrum
For your siren GUI in Python, add real-time plotting of the frequency spectrum of the produced signal. You should use the FFT. The frequency range should be in units of Hz (cycles/second). The user should see the frequency vary as the siren frequency changes.
Question 3: Frequency spectrum of a real siren Some real sirens have multiple frequencies (harmonics). They are not pure time-varying tones. Extract part of a real siren sound (not simulated) from a YouTube video or other source. Calculate and plot the frequency spectrum (Fourier transform) of a short segment of the sound. Plot the frequency spectrum using both a linear scale and decibel scale (y-axis) (2 plots). Does the spectrum show harmonics? If yes, then indicate them in your plot. In your submission, include the segment of the siren sound, your program, and a pdf file of your plot. You can use either Python or Matlab for this question. No video needs to be provided for this question.