Ploting Rayleigh faded signal copies

1 次查看(过去 30 天)
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');

采纳的回答

Daniel M
Daniel M 2019-10-23
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...

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Propagation and Channel Models 的更多信息

产品


版本

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by