MATLAB Answers

Why the spectrum I get from 'Visualiza​tion'-'Fre​quency response' in 'comm.RayleighChannel' is sometimes different from the spectrum I culculate from 'PathGainsOutputPort'?

2 ビュー (過去 30 日間)
zihao du
zihao du 2020 年 6 月 3 日
回答済み: Chaitanya Mallela 2020 年 9 月 30 日
Here is my codes, if I change 'Seed' number from '1' to '73', the spectrums will be different, why this happens?Thanks for help.
clear; clc; close all;
rchan = comm.RayleighChannel('SampleRate',1000, ...
'PathDelays',[0 1e-3 2e-3],...
'AveragePathGains',[0 -3 -6], ...
'MaximumDopplerShift',0, ...
'PathGainsOutputPort',true,...
'RandomStream','mt19937ar with seed','Seed',1,...
'Visualization','Frequency response');
[chanOut,pathGain] = rchan(1);
h = pathGain(1,:);
Nfft = 1000;
H = fft(h,Nfft);
H_power_dB = 10*log10(abs(H.*conj(H)));
figure;
plot((-Nfft/2+1:Nfft/2),H_power_dB,'k-');
hold on; xlabel('Frequency[Hz]'), ylabel('Channel power[dBw]');

回答 (1 件)

Chaitanya Mallela
Chaitanya Mallela 2020 年 9 月 30 日
Seed property corresponds to the generation of random stream.Seed serves as a unique identifier of a pseudo-random sequence i.e., for each particular seed there is a unique pseudo-random sequence.Once the seed is specified the same random stream is generated for each time when simulated.

Community Treasure Hunt

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

Start Hunting!

Translated by