Clear Filters
Clear Filters

Assistance with Transfer Function Output

2 views (last 30 days)
Hello, I currently have a PRBS input signal which I created using the frest.PRBS object. In addition, I also have a discretized transfer function which I have created.
I want to plot the time domain response of this PRBS Signal with a system response using the discretized transfer function. I tried to use the lsim command with the following arguments(transferFunction, prbsInput, time)
However, when I try to plot this I get an error stating: Error using DynamicSystem/lsim
When simulating the response to a specific input signal, the input data U must be a matrix of
numeric values with at least two rows (samples) and without any NaN or Inf.
Do you know how I can accomplish this plot of the system response? Would be a plus to have the output of the system represented as a vector of these values that are plotted so I can plot its eye diagram.
Some screenshots of the signal and the transfer function(tf)
Any help is greatly appreciated!

Accepted Answer

Paul
Paul on 25 Jul 2023
The second input to lsim, called 'input' in the code, has to be a vector (becuase Hd is single input) of numerical values. So you'll have to convert your PRBS input signal into numerical vector of samples taken at 0.1s sampling period (or as shown below some other object from with that vector of samples can be extracted).
input = frest.PRBS('Order',10,'NumPeriods',1,'Amplitude',1e-5,'Ts',0.1)
The PRBS input signal: Amplitude : 1e-05 Ts : 0.1 (secs) Order : 10 NumPeriods : 1 OneSamplePerClockPeriod (on/off) : on UseWindow (on/off) : on
inputts = generateTimeseries(input)
timeseries Common Properties: Name: 'Created from a frest.PRBS signal' Time: [1023x1 double] TimeInfo: tsdata.timemetadata Data: [1023x1 double] DataInfo: tsdata.datametadata
hd = tf([-4 3.5781],[1 -0.7047],0.1);
y = lsim(hd,inputts.Data,inputts.Time);
plot(inputts.Time,y)

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!