Skip to content
Snippets Groups Projects
Commit d73ab919 authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Use phase 0 for cos inData.

parent b4d766e6
Branches
No related tags found
1 merge request!420Resolve RTSD-264
Pipeline #98751 passed
......@@ -56,7 +56,7 @@ k = length(inData); % = len * Nhold
% 3) sine wave signal
%inData = cos(((1:k).^2 ) * len / (k)^2);
%inData = cos(2*pi*(1:k) * 0.031 / 16);
%inData = cos(2*pi*(1:k) * 4.0 / Nfft); % use integer for CW at bin
%inData = cos(2*pi*(0:k-1) * 1.5 / Nfft); % use integer for CW at bin
% 4) impulse signal
if ImpulseResponse == 1
......@@ -121,7 +121,7 @@ diff = outData - inData(1:length(outData));
% With DEVP = 0.005 and W0 = 1 / 15.05 then db(0.005) = -46.0 dB and SNR =
% 38.8 dB, so increased.
SNR = 10 * log10(sum(abs(inData(10000:70000) .^ 2)) / sum(abs(diff(10000:70000) .^ 2)));
sprintf('SNR = %6.2f [dB]', SNR)
sprintf('SNR = %.5f [dB]', SNR)
%plot(diff)
%plot(db(fft(outData))) %to see frequency error
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment