Getting Started | ![]() ![]() |
Finding the Delay in the Model
In constructing this model, to set the parameters for the Error Rate Calculation block and Delay block correctly, you need to know the delay between the transmitted and received signals. You can sometimes determine this delay from the parameters of the blocks between the transmitted and received signals. But if you are unable to determine the delay in this way, you can do so with the xcorr
function, from the Signal Processing Toolbox, which finds the cross correlation between the signal and shifts of its delayed version.
To use the xcorr
function, you must modify the model slightly as follows:
100
. This essentially removes all noise from the model.
Tx
.
Rx
.
1
.
When you are done, the model should appear as in the following figure.
Determining the Delay in the FSK Model
Running the model sends the transmitted and received signals to the workspace as vectors called Tx
and Rx
, respectively. To find the delay between Tx
and Rx
, type the following commands at the MATLAB prompt.
MATLAB should return delay=6
, which is the correct value of the delay.
The xcorr
function calculates the correlations between Tx
and Rx
when the two vectors are shifted in all possible ways that overlap. The maximum correlation occurs at the shifted distance corresponding to the true delay.
You can test whether you have found the correct value for the delay by using the MATLAB isequal
command, which returns a 1
when two vectors are equal, and a 0
when they differ. To do so, at the MATLAB prompt type
MATLAB returns a 1
if the number of symbols Tx
and Rx
are offset by is delay
.
If you use this procedure and MATLAB returns a 0 to the isequal
command, it might indicate that there is still noise present in the model.
![]() | Delays in the Model | Multirate Models | ![]() |