Question: IN PYTHON To illustrate the aliasing phenomenon, lets perform two simple experiments allowing us to hear some generated sounds. (a) Write a function [x, t]
IN PYTHON
To illustrate the aliasing phenomenon, lets perform two simple experiments allowing us to hear some generated sounds.
(a) Write a function [x, t] = sin_gen1(f0, fs, T) to generate a sine signal. The output parameters x and t are the signal and time vectors, respectively. The input parameters are f0 (signal frequency in Hz), fs (sampling frequency in Hz), T (signal duration in sec.).
(b) Test your sin_gen1 function with the input parameter values of sampling frequency =1000 Hz, f0=10 Hz and T=0.5, and display the result using the plot function.
(c) Generate two 1 kHz sine signals (2 seconds duration), first signal at 20 kHz sample frequency and second signal at 1.5 kHz sample frequency;
(d) On the same graph, use the plot function to display the two signals versus t in the range 0 < t < 5 msec.;
(e) Listen to the two signals one after another using the function soundsc(x, fs); and
(f) Give your interpretation of this listening.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
