0% found this document useful (0 votes)
14 views

For Switch Case Case Break Otherwise End End

The document records sound using an analog input, plots the recorded sound data over time, generates a carrier signal at 3000Hz, multiplies the recorded sound and carrier signals to produce a modulated signal, and plots the modulated signal alongside the original recorded sound data. It then displays 4 figures - the recorded sound over time, the carrier signal, the modulated signal, and a plot comparing the modulated signal to the original recorded sound data.

Uploaded by

Aryaan Revs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

For Switch Case Case Break Otherwise End End

The document records sound using an analog input, plots the recorded sound data over time, generates a carrier signal at 3000Hz, multiplies the recorded sound and carrier signals to produce a modulated signal, and plots the modulated signal alongside the original recorded sound data. It then displays 4 figures - the recorded sound over time, the carrier signal, the modulated signal, and a plot comparing the modulated signal to the original recorded sound data.

Uploaded by

Aryaan Revs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

ai = analoginput('winsound');

addchannel(ai, 1);
ai.SampleRate = 8000;
ai.SamplesPerTrigger = 40000;
ai.TriggerType = 'Immediate';
start(ai)
[d,t] = getdata(ai);
figure(1)
plot(t,d);
xlabel('time');
ylabel('Amplitude')
title('recoded sound')

for i=1:100
op = input('enter 1 for listen sound or press 2 to proceed');
switch(op)
case 1
sound(d);
case 2
break;
otherwise
disp('you enter the wrong option, try again.');
end
end

time = t';
f = 3000;
w = 2*pi*f;
c = sin(w*time);
figure(2)
plot(time,c);
xlabel('time');
ylabel('Amplitude')
title('carrier')

figure(3)
m = d'.*c;
plot(time,m);
xlabel('time');
ylabel('Amplitude')
title('modulated signal')

figure(4)
plot(time,d',time,m)
xlabel('time');
ylabel('Amplitude')
title('modulated signal and data signal')

ai = analoginput('winsound');
addchannel(ai, 1);
ai.SampleRate = 8000;
ai.SamplesPerTrigger = 40000;
ai.TriggerType = 'Immediate';
start(ai)
[d,t] = getdata(ai);
figure(1)
plot(t,d);
xlabel('time');
ylabel('Amplitude')
title('recoded sound')

for i=1:100
op = input('enter 1 for listen sound or press 2 to proceed');
switch(op)
case 1
sound(d);
case 2
break;
otherwise
disp('you enter the wrong option, try again.');
end
end

time = t';
f = 3000;
w = 2*pi*f;
c = sin(w*time);
figure(2)
plot(time,c);
xlabel('time');
ylabel('Amplitude')
title('carrier')

figure(3)
m = d'.*c;
plot(time,m);
xlabel('time');
ylabel('Amplitude')
title('modulated signal')

figure(4)
plot(time,d',time,m)
xlabel('time');
ylabel('Amplitude')
title('modulated signal and data signal')

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy