Exemple #1
0
def ParallelProcessing(location):
    Antilocation = location[1:4]

    P, S = ComputeRIRs(c, Fs, ReceiverLoc, SourceLoc, Antilocation, RoomSize,
                       beta, nsample, mtype, order, dim, orientation,
                       hp_filter)
    e_cont, Yd = ANCInAction(P, S, x, T, L, mu)
    Pd_dB, fd, Pe_dB, fe, EstimatedAttenuation, components = metrics(
        e_cont, Yd, Fs, T)

    features = np.append(Antilocation, EstimatedAttenuation)
    features = np.append(features, components)
    return features
def ParallelProcessing(location):
    SourceLoc       = location[0:3]
    ReceiverLoc     = location[3:6]
    Antilocation    = location[6:9]

    P, S            =   ComputeRIRs(c,Fs,ReceiverLoc,SourceLoc,Antilocation,RoomSize,beta,nsample,mtype,order,dim,orientation,hp_filter)
    PSpecFlat       =   SpectralFlatness(P, Fs)
    SSpecFlat       =   SpectralFlatness(S, Fs)
    e_cont, Yd  	=  	ANCInAction(P, S, x, T, L, mu)
    # Pd_dB, fd, Pe_dB, fe, EstimatedAttenuation, components =   metrics(e_cont, Yd, Fs, T)
    ANCRed          =   metrics(e_cont, Yd, Fs, T)
    features        =   np.append(location, [PSpecFlat, SSpecFlat, ANCRed])
    return features
Exemple #3
0
hp_filter = 1  # Enable high - pass filter
T = 24000  # Normalised Simulation Time
L = 800  # Set Filter Length
mu = 0.00001  # Set Learning Rate

#
print "Generating Input Signal"

x = GenerateSignal(T, Fs)
#
t1 = time.time()

print "Computing RIRs"

P, S = ComputeRIRs(c, Fs, ReceiverLoc, SourceLoc, AntiNoiseLoc,
                   RoomSize, beta, nsample, mtype, order, dim,
                   orientation, hp_filter)

print "Simulating ANC"

error, Yd = ANCInAction(P, S, x, T, L, mu)

# Pd_dB, fd, Pe_dB, fe, attenuation, components\
# = metrics(error, Yd, Fs, T)# print "Estimated \
# Attenuation is : ", attenuation, components

ANCRed = metrics(error, Yd, Fs, T)

#
# Generate Dynamic Power Spectral Density Graphs