run /users/swinkels/deploy/MatlabVirgoTools/trunk/startup.m %% get data g = utc2gps(2017,7,9); [d,t] = getChannel('LSC_NE_CORR', g, 200); %% generate some colored noise similar to NE_CORR filt_s = virgo2zpk([10,0.7;50,0.7],[0.1,0.7; 0.3, 0.7],1,0); filt_z = c2d(tf(z), 1 / 10000); A = filt_z.den{1}; B = filt_z.num{1}; w = white_noise(length(t), 10000); wf = filter(B,A,w); %% error due to convertion to single precision wfs = double(single(wf)); dw = wf - wfs; %% spectra nfft = 10000 * 40; [D,F] = pwelch(d, hann(nfft), nfft/2, nfft, 10000); [W,F] = pwelch(wf, hann(nfft), nfft/2, nfft, 10000); [DW,F] = pwelch(dw, hann(nfft), nfft/2, nfft, 10000); %% plot loglog(F,sqrt(D), F,sqrt(W), F,sqrt(DW)); xlabel('Frequency (Hz)') ylabel('LSC\_NE\_CORR (V/rtHz)') legend('LSC\_NE\_CORR', 'colored noise', 'noise - double(single(noise))')