How to get the complex-valued impulse response coefficients from comm.RayleighChannel

The magnitude of channel impulse response can be plotted by using the "visualization" property of comm.RayleighChannel as has been described in Filter input signal through multipath Rayleigh fading channel - MATLAB (mathworks.com) in the Section "Display Impulse and Frequency Responses of Multipath Rayleigh Fading Channel". However, I couldn't find a way of getting the actual complex values of these impulse response coefficients. The now obsolete Matlab command "rayleighchan" used to have the following syntax to get the complex-valued impulse reponse coefficients:
chan = rayleighchan(ts,fd,tau,pdb);
h = chan.PathGains;
In the above code, "h" is the impulse response of the channel.
Please note that I am not looking for the PathGains at each sample point. I know that it can be obtained by using the following commands:
chan = comm.RayleighChannel(...);
[y,PathGains] = chan(x);
where "x" is the input signal, "y" is the output signal, and "PathGains" represents the channel filter coefficients at each sample point and is not channel impulse reponse.

3 Comments

Hi,
Could you find the answer?
If yes, can you plese share the answer with me?
Thanks
Take a look on this paper : ( "Channel Estimation In OFDM systems" By Jan-Jaap van de Beek, Ove Edfors, Magnus Sandell Sarah Kate wilson and Petr Ola Borjesson In proceedings Of VTC'95 Vol 2 pg.815-819 )
Possibly it helps to generate the channel impulse response by using the path gain and path delays of comm.RayleighChannel function.

Sign in to comment.

Answers (1)

Hi Imran,
To obtain the complex impulse response coefficients of a multipath Rayleigh fading channel, you can pass a impulse signal to the comm.RayleighChannel system object.
impulse = [1; zeros(1023, 1)];
[~, pathGains] = rayleighchan(impulse);
Hope this helps.

3 Comments

Thanks a lot. It works but with two modifications.
First, the function name shouldn't be "rayleighchan" because in the new version of Matlab, this function has been removed. In fact, this was the primary reason that I had posted my question on 4 May 2022 that I am unable to get the impulse response coefficients using the new Matlab function "comm.RayleighChannel".
Second, even if I use your code after modifications (please see the example below), the number of output arguments of the last command expected by Matlab is one and not two despite the fact that Matlab documentation shows two output arugments.
Fs = 10e3;
tau = [0 1 2.5 5.4]*1e-3;
pdB = [0 -1.5 -2.5 -7];
Fd = 10;
chan = comm.RayleighChannel('SampleRate',Fs,'PathDelays',tau,'AveragePathGains',pdB,...
'MaximumDopplerShift',Fd,'Visualization','Impulse response');
impulse = [1; zeros(tau(end)*Fs, 1)];% To have as many samples in the impulse as needed
pathGains = chan(impulse); % Matlab doesn't accept two output arguments rather only one
On running the above code, the variable "pathGains" is indeed the impulse response.
Sometimes, the magnitudes of the impulse response (pathGains) do not match with the ones plotted by the "Visualization" option of "comm.RayleighChannel". I couldn't find an answer to this anomaly.
To get the second output parameter 'pathgains', set the PathGainsOutputPort property of the 'chan' object as true.
It is not running. Following warning is found -
"Array formation and parentheses-style indexing with objects of class 'comm.RayleighChannel' is not allowed. Use objects of class 'comm.RayleighChannel' only as scalars or use a cell array."

Sign in to comment.

Products

Release

R2019b

Community Treasure Hunt

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

Start Hunting!