In: Electrical Engineering
Design a Matlab program that records your voice for 5 seconds and then cuts off the low frequencies. Then, have the program play the edited recording.
clc
clear all
close all
T=input('Enter the time to speak: ');
[y,Fs]=RecordYourVoice(T);
t=0:1/Fs:(length(y)-1)/Fs; %time period
plot(t,y)
title('Time Domain Voice signal')
xlabel('Time (t) ')
ylabel('Amplitude')
[H,W]=freqz(y,1,2048,Fs); %Frequency spectrum
figure;
subplot(211)
plot(W/pi,abs(H/max(H)))
title('Frequency Spectrum')
xlabel('Frequency (Hz)')
ylabel('Ampltide')
Hd2=fdesign.highpass('N,Fc',15,500,8000); %Doesnot allow
frequency below 500Hz
H2=design(Hd2);
z2=filter(H2,y);
[H1,W1]=freqz(z2,1,1024,Fs); %Frequency spectrum
subplot(2,1,2)
plot(W1/pi,abs(H1/max(H1)))
title('Frequency Spectrum of High Pass filtered signal')
xlabel('Frequency (Hz)')
ylabel('Ampltide')
soundsc(z2,Fs)
High pass filter cut off frequnecy is taken 500Hz, Order is 15.
Please leave feedback