imran kandhro
Newbie level 6
hello ! can any one help me!!
i want to transmit fsk modulated signal from one pc to another pc through their sound cards! and these pc's are connected to each other via cord cable! the problem is i couldn't understand whether the signal is received or not? plz if any one knows guide me!
code for transmiter is given as (on the first pc)
and the receiver code is given as (on anther pc)
i want to transmit fsk modulated signal from one pc to another pc through their sound cards! and these pc's are connected to each other via cord cable! the problem is i couldn't understand whether the signal is received or not? plz if any one knows guide me!
code for transmiter is given as (on the first pc)
Code:
%transmitters
AO = analogoutput('winsound');
chan = addchannel(AO,1);
duration = 4;
SampleRate=44100;
set(AO,'SampleRate',SampleRate);
set(AO,'TriggerType','Manual')
ActualRate = get(AO,'SampleRate');
len = ActualRate*duration;
% code for signal genration
pi=3.14;
f1=5; % Baseband signal frequency
f2=25; % Carrier Frequency
x=[1 0 1 0 1 0 1 0 0 1];
nx=size(x,2);
i=1;
while i<nx+1
t = i:0.001:i+1;
if x(i)==1
fsk=sin(2*pi*f2*t)';
else
fsk=sin(2*pi*f1*t)';
end
axis([1 nx -2 2]);
i=i+1;
putdata(AO,fsk);
start(AO);
fprintf('press enter to take data in sound card..... \n');
pause
fprintf('sound card taking data....... \n');
trigger(AO);
fprintf('done... \n');
wait(AO,5);
subplot(2,1,1);
plot(t,fsk);
hold on;
grid on;
end
delete(AO);
and the receiver code is given as (on anther pc)
Code:
AI=analoginput('winsound')
addchannel(AI,1:2)
duration=4;
SampleRate=44100;
set(AI,'SampleRate',SampleRate);
set(AI,'TriggerType','Manual');
set(AI,'SamplesPerTrigger',duration*SampleRate);
start(AI);
fprintf('press enter to take data...\n');
pause
trigger(AI);
fprintf('taking data....\n')
[data,t]=detdata(AI);
disp('done');
plot(t,data)
delete(AI)
Last edited by a moderator: