필터 지우기
필터 지우기

Ploting Rayleigh faded signal copies

조회 수: 1 (최근 30일)
Ali Sabra
Ali Sabra 2019년 10월 23일
답변: Daniel M 2019년 10월 23일
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