From ff746bd29798a7b6995db2d95eb7bd4ff0da04d7 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Tue, 17 Jul 2018 10:52:14 +0000
Subject: [PATCH] Corrected DC level for uniform full scale ampl input.

---
 .../apertif/matlab/correlator_null_clip_or_wrap.m         | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/applications/apertif/matlab/correlator_null_clip_or_wrap.m b/applications/apertif/matlab/correlator_null_clip_or_wrap.m
index ca08bd58de..43669ce631 100644
--- a/applications/apertif/matlab/correlator_null_clip_or_wrap.m
+++ b/applications/apertif/matlab/correlator_null_clip_or_wrap.m
@@ -59,7 +59,7 @@ close all;
 %rng(0);    % random seed for repeatable result
 
 % Try different amplitudes
-ampl = 1.1;  % for input rand() or sin() use > 1 for overflow
+ampl = 1.5;  % for input rand() or sin() use > 1 for overflow
              % for input randn() ampl = sigma, so use >~ 0.3 for overflow
 
 N = 1000;
@@ -67,9 +67,9 @@ rad = [0:N-1]*2*pi/N;
 deg = [0:N-1]*360/N;
 
 % Try noise or sinus inputs
-input = ampl*randn(1,N);      % Gaussian with sigma = ampl
-input = ampl*2*rand(1,N)-1;   % Uniform full scale ampl range
-input = ampl*sin(rad);        % Sinus with amplitude = ampl
+input = ampl*randn(1,N);        % Gaussian with sigma = ampl
+input = ampl*(2*rand(1,N)-1);   % Uniform full scale ampl range
+input = ampl*sin(rad);          % Sinus with amplitude = ampl
 
 % Determine correlator output for the input and the phase shifted input
 % for reference, null, null_scaled, clip and wrap.
-- 
GitLab