I can see that you are trying to do two things:
1.) Use the results from “tfestimate” to reconstruct the output signal in time domain.
2.) Extend "tfestimate" for two-sided frequencies.
For the first question, you need to make sure that the operations you are performing are consistent with the nature of the Fourier transform and Convolution.
You can follow these steps to reconstruct the output signal:
1.) Multiply the Fourier transform of the input signal by the transfer function.
rr_in_filt_fft = fft(rr_in_filt);
rr_out_fft = txy_full .* rr_in_filt_fft;
2.) Convert the result back to the time domain.
rr_out_calc = real(ifft(rr_out_fft));
Now to answer the second question, by default the “tfestimate” function provides a one-sided spectrum. For reconstructing a two-sided spectrum:
- If “txy” is one-sided, you need to mirror it to form a two-sided spectrum before performing the inverse FFT. This involves appending the complex conjugate of the flipped non-redundant part of the spectrum:
txy_full = [txy; conj(txy(end-1:-1:2))];
By following these steps, you should be able to reconstruct the output signal using the transfer function estimated by “tfestimate”.
For my testing, I used simple sine wave signals for input and output signals, and plotted these figures:
- Filtered Input Signal
- Filtered Output Signal
- Reconstructed Output Signa
You can refer to these documentation for more help:
Hope this helps!