PC
PROJECT
NAME: Sarikhada Mansi U16EC084
Sai Pranav.
U16EC090
Aim : Record your own voice signal and then perform amplitude modulation, add
some noise and then demodulate to reconstruct the signal.
Block diagram:
Code:
fs = 44100;
fc = 3000;
y = wavread('C:/Users/sirip/music/mansi.wav'); //Put location of input file
input_sound = y(1,:);
t = 0:1/fs:(length(input_sound)-1)/fs;
df = fs/(length(t)-1);
F = -fs/2:df:fs/2;
subplot(321);
title("Input Sound",'position',[9.2 0.2]);
plot(t,input_sound);
subplot(322);
plot(F,fftshift(fft(input_sound))/(length(t)-1));
c_t = cos(2*%pi*fc*t);. //Carrier wave
Ac = 10;. //Carrier amplitude
AM = (Ac*c_t).*(input_sound); //AM wave DSC-SC
noise = rand(1,length(input_sound),'normal')/20;. //Add Noise to the audio clip
AM=AM+(noise);
subplot(323);
title("AM wave + noise",'position',[8.8 1.4]);
plot(t,AM);
subplot(324);
plot(F,fftshift(fft(AM))/(length(t)-1));
H = iir(4,'lp','butt',fc/fs,[0 0]);. //LPF filter
demod = AM.*c_t;
output_sound = flts(demod,H);. //Plot Output Waveform
subplot(325);
title("Filtered wave",'position',[9.2 0.7]);
plot(t,output_sound);
subplot(326);
plot(F,fftshift(fft(output_sound))/(length(t)-1));
playsnd(output_sound,44100);