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');