I am working on noise cancellation in ecg signal and I want to calculate the Signal to noise ratio(SNR) before applying filter to the signal and after applying filter i.e., snr_before and snr_after. I used the following commands:
snr_before = mean(input_or_desired_signal.^2)/mean(noise_signal.^2); residual_noise = desired_signal - filtered_output_signal; snr_after = mean( desired_signal .^ 2 ) / mean( residual_noise .^ 2 );
The code works as no error is generated. But only the box is displayed when I plot d same in each case and no graph is generated.. Pls help Thanks in advance..