Exemplo n.º 1
0
def runTrial():
    GpsSignal = TrackingLoop.InitGpsSignal(1,1)

    minPLLBW = 10
    maxPLLBW = 32
    minFLLBW = 0
    maxFLLBW = 15
    PLLRange = np.arange(minPLLBW,maxPLLBW)
    FLLRange = np.arange(minFLLBW,maxFLLBW)

    for CNO in range(45,46):
        manifold = np.zeros((1*(maxPLLBW-minPLLBW),1*(maxFLLBW-minFLLBW)))
        T,SignalIn,stateHistory = GenSignal.constantJerk(1,CNO,200)

        for PLLBW in PLLRange:
            for FLLBW in FLLRange:
                startTime = time.time()
                Z,DcoFreqArray,LockStateValues,PhaseError 
                = runReceiver(T,SignalIn,PLLBW,FLLBW)
                LockStateValues = np.where(LockStateValues == 3, 1, 0)
                breakingPoint = 200*(np.mean(LockStateValues)) #m/s^2
                
                if breakingPoint<0:
                    breakingPoint=0

                manifold[1*(PLLBW-minPLLBW),1*(FLLBW-minFLLBW)] 
                = breakingPoint
                
        plt.title('Breaking point $(m/s^2)$')
        plt.ylabel('PLL Bandwidth (Hz)')
        plt.xlabel('FLL Bandwidth (Hz)')

        CS = plt.contour(FLLRange,PLLRange,manifold,colors='k')
        
        plt.clabel(CS,CS.levels,inline=True,fontsize=10)

        levels =[-1,0]
        plt.contourf(FLLRange,PLLRange, \
        manifold,levels,colors = ('r'),alpha=0.7)
        
        plt.grid()
        plt.savefig('Acceleration.eps', format='eps', dpi=1000)
        plt.close()