Borrar filtros
Borrar filtros

Simulate a non linear system from input and output signals

1 visualización (últimos 30 días)
suniya vs
suniya vs el 22 de Ag. de 2023
Respondida: Ayush el 29 de Ag. de 2023
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');

Respuestas (1)

Ayush
Ayush el 29 de Ag. de 2023
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

Community Treasure Hunt

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

Start Hunting!

Translated by