Hi, I have 3 things I need to find –
- What are the two prominent frequencies in the doorbell file? __________ and ______________
2. At what frequencies you see peaks corresponding to noise in spectrum? _____________ and ________________. Their amplitudes are ___________ and _____________
3.Plot the convolved spectrum. The new amplitude values of the noise are__________________________ and _________________.
I know I need to do 1 at y_spectrum, 2 at new_sound_array, and 3 at pwelch(Final_new_array). How do I do this with MATLAB?
clc;
close all;
clear all;
[y,Fs]=audioread('doorbell.wav');%reading audio file
y=y';
y_spectrum=pwelch(y);
sound(y_spectrum);%playing the spectrum using sound function
%% creating noise vectors
t=0:1/Fs:2;
t1=t(1,1:33292);
f1=4000;
a1=0.2;
x1=a1*sin(2*pi*f1*t1);
f2=5000;
a2=0.25;
x2=a2*sin(2*pi*f2*t1);
%% adding noise vectors to sound array
new_sound_array=y+x1+x2;
sound(new_sound_array,Fs);
new_sound_array_spectrum=pwelch(new_sound_array);
sound(new_sound_array_spectrum);
%%convolution of H array with new_sound_array
H=[0.0065 0.0103 0.0210 0.0382 0.0599 0.089 0.1032 0.1171 0.1221 0.1171 0.1032 0.0829 0.0599 0.0382 0.0210 0.0103 0.0065];
Final_new_array=conv(new_sound_array,H);
Final_new_array_spectrum=pwelch(Final_new_array);
sound(Final_new_array_spectrum);
Best Answer