LAB#4 REG NO:-16-EE-539 Title of Lab: Principle of Working SSB Speech Scrambling
LAB#4 REG NO:-16-EE-539 Title of Lab: Principle of Working SSB Speech Scrambling
Title of Lab
Telephone networks
TV networks
Submarine communication system
The working of the FDM we can understand from following figure
LAB TASKS:-
1) Record five 1 sec voice messages using audio recorder at 44100Hz.
2) Open each recorded file using audioread function in vectors 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 , 𝑥5 .
3) Trim the files to be same the length vectors using matlab vector indexing
4) Low pass filter each speech vector with cut-off frequency of 4kHz.
5) SSB modulate each of the signals 𝑥2 , 𝑥3 , 𝑥4 , 𝑥5 with 4kHz, 8kHz, 12kHz and 16kHz carriers. Use
6) Sum 𝑥1 and the SSB modulated 𝑥2 , 𝑥3 , 𝑥4 , 𝑥5 to a variable group.
7) Save the file as ‘group.wav’ using audiowrite function.
8) Open ‘group.wav’ in a new matlab script.
9) SSB demodulate each of the message signals.
10) Playback audio signal using sound function.
11) Plot spectra of the signals at every step.
CODE:-
clear all;clc
fs=44100; %Sampling frequency
size=16; %sampling size
chn=1; %channel
Ts = 1/fs;
t = 0:Ts:1;
t=t(1:fs);
t=t';
record= audiorecorder(fs,size,chn);
disp(Record 1')
recordblocking(record, 1);
disp('Recording Stoped');
Recording11= getaudiodata(record1);
audiowrite('voice1.wav',Recording11,fs);
disp('Record 2')
recordblocking(record, 1);
disp('Recording Stopped');
Recording12= getaudiodata(recObj);
audiowrite('voice2.wav',Recording12,fs);
disp('Record 3’)
recordblocking(record, 1);
disp('Recording Stopped');
Recording13= getaudiodata(recObj);
audiowrite('voice3.wav',Recording13,fs);
disp('Record 4')
recordblocking(record, 1);
disp('Recording Stopped');
Recording14 = getaudiodata(record);
audiowrite('voice4.wav',Recording14,fs);
disp('Record 5')
recordblocking(record, 1);
disp('Recording Stopped');
Recording15 = getaudiodata(record);
audiowrite('voice5.wav',Recording15,fs);
subplot(611)
plot(t,Recording11);
subplot(612)
plot(t,Recording12);
subplot(613)
plot(t,Recording13);
subplot(614)
plot(t,Recording14);
subplot(615)
plot(t,Recording15);
lowPass = fir1(48,[0.1/fs/2 4000/fs/2]);
xx1 = filter(lowPass,1,Recording11)
xx2 = filter(lowPass,1,Recording12)
xx3 = filter(lowPass,1,Recording13)
xx4 = filter(lowPass,1,Recording14)
xx5 = filter(lowPass,1,Recording15)
subplot(611)
plot(abs(fftshift(fft(xx1))));
subplot(612)
plot(abs(fftshift(fft(xx2))));
subplot(613)
plot(abs(fftshift(fft(xx3))));
subplot(614)
plot(abs(fftshift(fft(xx4))));
subplot(615)
plot(abs(fftshift(fft(xx5))));
FREQ=4000:4000:16000;
g1=x1;
g2=x2.*(cos(2(pi)FREQ(1)*t)+hilbert(x2).*hilbert(sin(2(pi)FREQ(1)*t)));
g3=x3.*(cos(2(pi)FREQ(2)*t)+hilbert(x3).*hilbert(sin(2(pi)FREQ(2)*t)));
g4=x4.*(cos(2(pi)FREQ(3)*t)+hilbert(x4).*hilbert(sin(2(pi)FREQ(3)*t)));
g5=x5.*(cos(2(pi)FREQ(4)*t)+hilbert(x5).*hilbert(sin(2(pi)FREQ(4)*t)));
group=g1+g2+g3+g4+g5;
plot(t,group)
diagram
plot(abs(fftshift(fft(group))));
c=fir1(49,[.1/fs/2 4000/fs/2])
v1=filter(c,1,group)
v1=real(v1)
sound(v1,44100)
diagram
plot(t,v1)
c1=fir1(49,[4000/fs/2 8000/fs/2])
v2=filter(c1,1,group)
v2=real(v2)
sound(v2,44100)
diagram
plot(t,v2)
c3=fir1(49,[8000/fs/2 12000/fs/2])
v3=filter(c3,1,group)
v3=real(v3)
sound(v3,44100)
diagram
plot(t,v3)
c4=fir1(49,[12000/fs/2 16000/fs/2])
v4=filter(c4,1,group)
v4=real(v4)
sound(v4,44100)
diagram
plot(t,v4)
Output:-
Conclusion:--In this lab we learnt the following concepts and know how to record voice
signal on matlab