Ploting Rayleigh faded signal copies

2 Ansichten (letzte 30 Tage)
Ali Sabra
Ali Sabra am 23 Okt. 2019
Beantwortet: Daniel M am 23 Okt. 2019
Hello everyone, I am looking for a way to sum a Rayleigh faded sine wave with its delayed Rayleigh faded version. I am trying to plot them in figure and to plot the original signal in another one to see the difference. I want to plot both of them versus time not only the original signal as in the figure.
c1 = rayleighchan(1/1600,100);
%c1.PathDelays = [0 1e-6];
%%Time specifications:
Fs = 1600; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 62.5; % seconds
t = (0:dt:StopTime-dt)'; % seconds
%Sine wave
Fc = 1; % hertz
sin = cos(2*pi*Fc*t);
% Plot the signal versus time:
figure (6);
%subplot (2,2,1)
%plot(t,sin);
%xlabel('time (in seconds)');
% title('Signal versus Time');
% zoom xon;
%subplot(2,2,2)
sin1 = filter (c1,sin);
% plot (t,10*log10 (abs(sin1)));
%subplot(2,2,3)
plot (t,sin1);
xlabel('time (in seconds)');
title('Signal versus Time');
% now shift the signal in time by zeropadding at the beginning:
tau = 802*dt;
y = [ tau ; sin1 ];
% Also, let's zeropad x at the end so that it has the same length as y:
sin1 = [ sin1 ; tau ];
% Create a simple time domain:
n = (1:size(z,1))';
z = sin1 + y;
% plot both signals:
figure(2);
plot(n,z,'r');
legend('z');

Akzeptierte Antwort

Daniel M
Daniel M am 23 Okt. 2019
figure
plot(t,real(sin1))
hold on
plot(t,imag(sin1))
xlabel('Time')
Or, using subplot
figure
subplot(2,1,1)
plot(t,real(sin1))
title('title for subplot1')
xlabel('xlabel for subplot 1')
subplot(2,1,2)
plot(t,imag(sin1))
title('title for subplot 2') % etc...

Weitere Antworten (0)

Kategorien

Mehr zu Propagation and Channel Models finden Sie in Help Center und File Exchange

Produkte


Version

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by