# Assistance with Transfer Function Output

3 vues (au cours des 30 derniers jours)
Rohan Gulur le 25 Juil 2023
Commenté : Rohan Gulur le 26 Juil 2023
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!
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Paul le 25 Juil 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)
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Rohan Gulur le 26 Juil 2023
This worked great. Really appreciate it Paul.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Correlation and Convolution dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by