Search code examples
matlabtransfer

Applying estimated transfer function to a signal to simulate channel


I'm trying to simulate an audio transmission channel from some samples: I have original recordings and the ones recorded with distortion. I'm using tfestimate() in order to obtain a transfer function estimate. But now I'm a little bit confused about how to apply it to create simulated distortion. What I tried to do is:

res = tfestimate(...)                     % get TF from clean and noisy record.
c = abs(ifft(res));                       % convert to time domain
out = conv(signal, c);                    % filter
wavwrite(out, 16000, 16, '/tmp/out.wav'); % dump

but I'm not happy with the result, it just sounds very differently.

is there a better way to apply the transfer function estimate "res" to the input "signal"?


Solution

  • Just to be clear, your "original recordings and the ones recorded with distortion" were recorded at the same time, right? And the distortion process does not add noise?

    Instead of computing the transfer function in the frequency domain with tfestimate and then trying to invert it, it would be more direct to compute the FIR Wiener filter that turns the original recording into the distorted version.

    Alternatively, you could try to fit the transfer function returned by tfestimate and then turn it into a time-domain filter. The function invfreqs is a good place to start; it will fit a ZPK model to the measured frequency response.