Simulate a non linear system from input and output signals

6 次查看(过去 30 天)
My system is non linear. There is some harmonics in the output signal. Using this code i cant replicate my output signal. Simulated signal does not contain harmonics. How can i change the code?
clear all;close all;clc;
[inpSig,fs]=audioread('varFsin_1K.wav');
[outSig, Fs] = audioread('AliELENvarFsin_1K261104b500_8_23.wav');
windowLength = 256;
win = hamming(windowLength,"periodic");
overlap = round(0.75 * windowLength);
ffTLength = windowLength;
Ts=1;
data = iddata(outSig,inpSig,Ts)
nx = 10;
sys = ssest(data,nx);
compare(data,sys)
dt = 1/Fs;
t=0:dt:(length(inpSig)*dt)-dt;
z=lsim(sys,inpSig,t)
spectrogram(z,win,overlap,ffTLength,Fs,'yaxis');

回答(1 个)

Ayush
Ayush 2023-8-29
To replicate the harmonics in your output signal using the provided code, you can try the following steps:
  • Increase the model complexity:
nx = 15;
sys = ssest(data, nx);
  • Adjust the window length and overlap: Increasing the window length and reducing the overlap can provide a higher resolution spectrogram.
windowLength = 512; % Increase the window length
overlap = round(0.5 * windowLength); % Reduce the overlap
  • Adjust the spectrogram parameters: Increasing ffTLength can provide a higher frequency resolution.
ffTLength = 1024; % Increase the FFT length
You may read further from here:
Thanks,
Ayush Jaiswal

类别

Help CenterFile Exchange 中查找有关 Acoustics, Noise and Vibration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by