Beispiel #1
0
    # Each components individually
    # ampChan_nd[iAmpIncr] = ampChan_nd[iAmpIncr] + ampInc
    # ampChan_nd[iAmpDecr] = ampChan_nd[iAmpDecr] - ampInc

    ampExc_nd = ampChan_nd.flatten(order='F')

    sigList, phaseElem_rad, sigElem = GenExcite.MultiSine(freqExc_rps, ampExc_nd, sigIndx, time_s, costType = 'Schroeder', phaseInit_rad = 0, boundPhase = True, initZero = True);
    sigPeakFactor = GenExcite.PeakFactor(sigList)
    ampChan_nd = ampExc_nd[sigIndx]


#%%
# Leakage Goal
uN2EGoal_dB = 20.0
uN2EGoal = db2mag(uN2EGoal_dB)
binGoal = FreqTrans.LeakageGoal(1/uN2EGoal, winType = 'boxcar')[0]
# binGoal = FreqTrans.LeakageGoal(1/uN2EGoal, winType = 'hann')[0]

freqStepDes_rps = (10 / 50) * hz2rps
tBinWidth = FreqTrans.FreqStep2TimeBin(freqStepDes_rps)

# XXX - SNR Goal - zSNRProjectMean = numSeg * np.mean(zSNRCurr)
zSNRGoal = 80
numCyclesSNR = zSNRGoal / np.mean(zSNRCurr)

tLeakageGoal = binGoal * tBinWidth

# Estimate how many cycles are required to achieve objective
tCycle = 1/(freqMinDes_rps * rps2hz)[0]
numCyclesLeakage = tLeakageGoal / tCycle
Beispiel #2
0
pi = np.pi

hz2rps = 2 * pi
rps2hz = 1 / hz2rps

rad2deg = 180 / pi
deg2rad = 1 / rad2deg

mag2db = control.mag2db
db2mag = control.db2mag

#%%
W_dB = -20.0
W = db2mag(W_dB)

fBinSel = FreqTrans.LeakageGoal(W, winType='Dirichlet')[0]

#%%
freqRate_hz = 50
freqRate_rps = freqRate_hz * hz2rps
dt = 1 / freqRate_hz

freqMinDes_hz = 0.1
numCyclesDes = 3  # Plan for 3

freqStepDes_hz = 0.1

#%% Excitation
numCycles = 6  # Need 6!
numChan = 2
ampInit = 1