$30
Problem 1: Using filter and difference equation
Matlab provides the filter function which is a Direct Form-II transposed implementation of the standard difference equation. Such functions save coding time and help us to focus more on the system behavior.
a) Re-do problem-3 of Classwork-2 and implement using the ‘filter’ command to filter out the high frequency components of the ECG signal.
b) Instead of using ‘filter’ command, convolute the ECG signal with h = [1/3, 1/3, 1/3] using ‘conv’ function. Compare the result with that of (a).
c) Write your own convolution function and re-do (b) using your convolution function.
Problem 2: Basics about sinusoids and sampling rate
Let the sampling rate fs be 50 Hz, and the time array t varies from 0 to 1 second.
a) Create and plot a sine signal 𝒚𝟏(𝒕) = 𝐬𝐢𝐧(𝟐𝝅𝒇𝟏𝒕), where 𝒇𝟏 = 𝟏𝟎 𝑯𝒛
b) Create and plot a sine signal 𝒚𝟐(𝒕) = 𝐬𝐢𝐧(𝟐𝝅𝒇𝟐𝒕), where 𝒇𝟐 = 𝟔𝟎 𝑯𝒛
c) Can you differentiate between 𝒚𝟏(𝒕) and 𝒚𝟐(𝒕) plot? Why?
Problem 3: Signal data to sound
Let the sampling rate fs be 50 kHz, and the time t varies from 0 to 1 second.
a) Create and plot a 2 kHz signal 𝒚𝟏(𝒕) = 𝐬𝐢𝐧(𝟐𝝅𝒇𝟏𝒕) using Matlab. Let the horizontal axis vary from 0 to 0.01 second. Use the command ‘sound(signal, sampling rate)’ to listen the tone.
b) Create, plot and listen to the sine signal 𝒚𝟐(𝒕) = 𝐬𝐢𝐧(𝟐𝝅𝒇𝟐𝒕), where 𝒇𝟐 = 𝟔 𝒌𝑯𝒛. How different is the sound of y2 in comparison to the sound of y1?
c) Create, plot and listen to the sine signal 𝒚𝟑(𝒕) = 𝐬𝐢𝐧(𝟐𝝅𝒇𝟑𝒕), where 𝒇𝟑 = 𝟐𝟓 𝒌𝑯𝒛. Can you still hear the sound?