Question
PLEASE DO IN PYTHON CODE (a) Write a function [x, t] = sin_gen1(f0, fs, T) to generate a sine signal. The output parameters x and
PLEASE DO IN PYTHON CODE
(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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started