import sys import numpy as np import math from scipy.fft import fft import OANPd from numpy import log10 #import xiangguan import time print("complete") #OANPd.call_oanp('SAW2577_20200923_150000.wav', -164, 0, isPlot=True) np.random.seed(12) freq=500 c=1500 M=15 T=20 fs=10000 N=fs*T the0=20 t=np.arange(0,T,1/fs) t=np.tile(t,(M,1)) noi=np.random.randn(M,N) r=1 d=r*np.arange(0,M) tau0=-(d*np.sin(the0/180*np.pi))/c tau0=tau0.reshape(M,1) sig=np.cos(2*np.pi*freq*(t-tau0)) x=1*sig+1*noi #x=noi #x=sig fmin=450 fmax=550 fp=500 dtheta=1 [fr,C]=OANPd.oancor(x,fs,round(0.5*fs),round(0.1*fs),fmin,fmax) OANPd.plot_oancor(fr,C,d,fp,fs) [theta,f,B]=OANPd.oandi(x,fs,d,dtheta,round(0.5*fs),round(0.1*fs),c,fmin,fmax) OANPd.plot_oandi(theta,f,B,fp)