I have implemented RLS algorithm using adaptive filter on TMS320C6713 DSK.I want to calculate the signal to noise ratio.
In this forum I found a method that I should input a speech signal with a silence portions in between. From the output of the adaptive filter I took sample of the silence considering it as a residual noise and the speech part considering it as (speech+ residual noise).
And then calculated SNR in MATLAB as follows:
snr=mse(output_speech)-mse(residual_noise)/mse(residual_noise);
snr_db=10*log10(snr);
If I calculate using this formula I get $40\textrm{ dB}$ improvement.Is this a correct way to calculate SNR?
Second method that I found on this forum was:
residual_noise = mse(output)-mse(input_speech);
snr_after = mse(speech) /residual_noise;
snr_after_db = 10 * log10( snr_after);
with the second method I had to normalize the two signals. I made the max amplitude of both signals look same using MATLAB:
output=output*(max(input)/max(output));
Is this a corect way to normalize it? Using this normalization and formula I got SNR improvement of $10\textrm{ dB}$.
I aligned the signal using MATLAB's scorer
function, but still I see some misalignment.
I am really confused which method to use and how can I verify it. Kindly please help.