[Matlab] using rayleighchan.m

  • Thread starter yongs90
  • Start date
  • Tags
    Matlab
In summary, to check the impulse response of the chan variable, use the "impz" function in MATLAB. Make sure the variables in the code match those given in Questions.pdf.
  • #1
yongs90
6
0

Homework Statement


Anybody knows how to use rayleighchan.m to accomplished the task given in Questions.pdf, the coding use to solve Questions.pdf is given in Matlab Code.doc. After running the code in Matlab Code.doc in Matlab programme the plot obtained is as shown in Plot.jpg


Homework Equations



Plot.jpg

View attachment Matlab Code.doc
View attachment Questions.PDF

The Attempt at a Solution



n=sqrt(0.5)*randn(1,100001)+ j*sqrt(0.5)*randn(1,100001);
chan = rayleighchan(0.1e-3,100);
a=filter(chan,n);
[c,lags]=xcov(a,'coeff');
lags_new=0.1e-3*lags;

figure(1)
plot(lags,real(c),'--r')

grid on
xlabel('Time Delay (s)')
ylabel('Normalised Autocorrelation')
legend('Simulation')


However, the plotted graph given is not right. Anybody knows how i can check the impulse response of chan (variable name) so that i can compare it with hw_norm (variable name) in Matlab Code.doc??
 
Physics news on Phys.org
  • #2


Hi there,

To check the impulse response of the chan variable, you can use the "impz" function in MATLAB. This function calculates and plots the impulse response of a system.

You can use it like this:

impz(chan)

This will plot the impulse response of the chan variable, which you can then compare with the hw_norm variable in the Matlab Code.doc.

Also, make sure that the variables used in the code (such as the sampling rate and number of samples) match those given in Questions.pdf.

I hope this helps! Let me know if you have any further questions. Good luck!
 

1. What is the purpose of using the rayleighchan.m function in Matlab?

The rayleighchan.m function in Matlab is used to simulate a Rayleigh fading channel for wireless communication systems. It generates a random channel model that takes into account the effects of multipath propagation and attenuation, which are common in wireless communication environments.

2. How do I use the rayleighchan.m function in my Matlab code?

To use the rayleighchan.m function, you first need to define the parameters of your communication system such as the carrier frequency, bandwidth, and sampling rate. Then, you can call the function and specify the number of channels you want to simulate. The output of the function will be a channel object that can be used in your code.

3. Can the rayleighchan.m function be used for both narrowband and wideband channels?

Yes, the rayleighchan.m function can be used for both narrowband and wideband channels. You can specify the bandwidth of your channel in the function parameters to generate a channel with the desired bandwidth. The function also allows you to specify the Doppler shift, which is important for wideband channels.

4. How does the rayleighchan.m function simulate the effects of multipath propagation?

The rayleighchan.m function uses the Jakes' model to simulate the effects of multipath propagation. This model assumes that the received signal is a combination of multiple copies of the transmitted signal that have undergone different path delays and attenuations due to reflections and scattering in the environment.

5. Can I customize the rayleighchan.m function to fit my specific communication system?

Yes, the rayleighchan.m function allows you to specify various parameters such as the number of paths, path delays, and path gains to customize the generated channel model. You can also add additional effects such as shadowing or fading due to weather conditions to better fit your specific communication system.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
955
  • Engineering and Comp Sci Homework Help
Replies
7
Views
888
  • Engineering and Comp Sci Homework Help
Replies
15
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • Introductory Physics Homework Help
Replies
1
Views
999
  • Engineering and Comp Sci Homework Help
Replies
4
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
4K
Back
Top