##################### DeepLearning-Matrix ##########################
################   Elevation    Azimuth      Frequenzbänder  Frames
DL_Matrix = zeros((NPOINTS_ELE, NPOINTS_AZI, len(FREQBANDS), FRAMES))
# Wenn .npz, dann keine FRAMES, weil die in einzelne .npy-Tabellen?!
# DL_Matrix = zeros((NPOINTS_ELE, NPOINTS_AZI, len(FREQBANDS)))

for frame_index, frame in enumerate(range(STARTFRAME, ENDFRAME)):
    print('### FRAME: ', frame - STARTFRAME, ' (', frame, ') ###')
    for freq_index, freq in enumerate(FREQBANDS):
        print('FREQ =', freq)
        ts.start = frame * NUM
        ts.stop = (frame + 1) * NUM

        result = zeros((4, rg.shape[0], rg.shape[1]))
        for i in range(4):
            be.n = i
            result[i] = be.synthetic(freq, 3)

        maxind = argmax(result.max((1, 2)))
        # WARUM IMMER MAXINDEX = 3 ???
        #        print('Result Beamforming: Maxindex = ', maxind)

        Lm = L_p(result[maxind]).reshape(rg.shape).flatten()

        max_idx = argmax(
            Lm.flatten())  # position in grid with max source strength
        max_cartcoord = rg.gpos[:, max_idx]

        max_idx = argmax(
            Lm.flatten())  # position in grid with max source strength
        max_value = amax(Lm.flatten())
Exemplo n.º 2
0
# Opt 1
maxval1 = zeros(len(FREQBANDS))
maxval2 = zeros(len(FREQBANDS))

# Opt 2
tot_maxval1 = 0
tot_maxval2 = 0

# Opt 3
tot_maxval = 0

# Befüllen von Src1_Matrix und Src2_Matrix
for freq_index, freq in enumerate(FREQBANDS):
    
    be.n = -1 #Eigenwerte der Größe nach sortiert -> größter Eigenwert (default)
    Lm = L_p(be.synthetic(freq, 3)).reshape(rg.shape).flatten()
    Src1_Matrix[:,:,freq_index] = Lm.reshape(rg.shape).T

    max_idx1 = argmax(Lm.flatten()) # position in grid with max source strength
    max_value1 = amax(Lm.flatten())


    be.n = -2 #Eigenwerte der Größe nach sortiert -> größter Eigenwert (default)
    Lm = L_p(be.synthetic(freq, 3)).reshape(rg.shape).flatten()
    Src2_Matrix[:,:,freq_index] = Lm.reshape(rg.shape).T

    max_idx2 = argmax(Lm.flatten()) # position in grid with max source strength
    max_value2 = amax(Lm.flatten())
    
    # Opt 1