Home > NoiseTools > test_nt_bias_fft.m

# test_nt_bias_fft

## PURPOSE

test nt_bias_fft

## SYNOPSIS

This is a script file.

## DESCRIPTION

     test nt_bias_fft

## CROSS-REFERENCE INFORMATION

This function calls:

- nt_bias_fft [c0,c1]=nt_bias_fft(x,freq,nfft) - covariance with and w/o filter bias
- nt_dss0 [todss,pwr1,pwr2]=nt_dss0(c0,c1,keep1,keep2) - dss from covariance
- nt_mmat y=nt_mmat(x,m) - matrix multiplication (with convolution)
- nt_spect_plot2 nt_spect_plot2 - plot power spectrum

This function is called by:

## SOURCE CODE

    0001 % test nt_bias_fft
    0002
    0003 nsamples=10000;
    0004 nchans=10;
    0005 SNR=0.0001;
    0006 f=20; % Hz
    0007 sr=1000;
    0008
    0009 if 0
    0010 x=randn(nsamples,nchans);
    0011 x(:,1)=SNR*sin(2*pi*f*(1:nsamples)'/sr);
    0012 x=x*randn(nchans);
    0013 end
    0014
    0015 figure(1); clf
    0016 nt_spect_plot2(x,512,[],[],sr);
    0017
    0018
    0019 [c0,c1]=nt_bias_fft(x,[20]/sr,2048); [todss,pwr0,pwr1]=nt_dss0(c0,c1);
    0020 figure(2); clf;
    0021 plot(pwr1./pwr0,'.-')
    0022 z=nt_mmat(x,todss);
    0023 figure(3); clf
    0024 nt_spect_plot2(z,512,[],[],sr);