Assistance with Transfer Function Output

조회 수: 6 (최근 30일)
Rohan Gulur
Rohan Gulur 2023년 7월 25일
댓글: Rohan Gulur 2023년 7월 26일
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!

채택된 답변

Paul
Paul 2023년 7월 25일
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
Rohan Gulur
Rohan Gulur 2023년 7월 26일
This worked great. Really appreciate it Paul.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by