Ejemplo n.º 1
0
def p_function5(p):
    'function : PLOT FOURIERTRANSFORM exprname COMMA expression'
    pol = FourierTransform(names[p[3]], int(p[5])).compute()
    p[0] = pol
Ejemplo n.º 2
0
def p_function3(p):
    'function : PLOT FOURIERTRANSFORM LPARENT expression RPARENT'
    p[0] = str(p[1]) + '(' + str(p[3]) + ')'
    pol = FourierTransform(p[3]).compute()
    #print pol
    p[0] = pol
Ejemplo n.º 3
0
def p_function2(p):
    'function : PLOT FOURIERTRANSFORM exprname'
    equation, number_pointsamples = names[p[3]].split(',')
    pol = FourierTransform(equation, int(number_pointsamples)).compute()
    # print pol
    p[0] = pol
Ejemplo n.º 4
0
def p_function1(p):
    'function : FOURIERTRANSFORM LPARENT expression COMMA expression RPARENT'
    pol = FourierTransform(p[3], int(p[5])).computefft()
    p[0] = pol
Ejemplo n.º 5
0
def p_function(p):
    'function : PLOT FOURIERTRANSFORM expression COMMA expression'
    pol = FourierTransform(p[3], int(p[5])).compute()
    #print pol
    p[0] = pol
Ejemplo n.º 6
0
softmask.load_state_dict(torch.load(softmaskModelPathName))
softmask.eval()

#---------------------------------------------------------------------------------------------------------

freqBandCnt = 240  # number of frequency bands to produce from fast Fourier transform
(frame_size, frame_stride) = (0.030, 0.010
                              )  # audio frame size and frame stride in seconds

# load the background white noise file
noiseFilePathName = 'C:\\Data\\WAV\\Environment\\' + 'Whitenoise2_16K' + '.wav'
#
channel, spectrogram, phasegram, frqcyBnd, sample_rate, sample_cnt, fft = FourierTransform.FFT(
    noiseFilePathName,
    0,
    frame_size,
    frame_stride,
    duration=4,
    emphasize=False)
spect_noise = torch.as_tensor(spectrogram, dtype=torch.float)
spect_noise /= 25  # The noise was scaled down in amplitude when it was mixed with the pure voice.  It needs to be scaled down by the same scale.
(_, _, frameCnt_noise) = np.shape(spect_noise)

# load a sample audio file
pathName = "C:\\Data\\TIMIT\\Data\\TRAIN\\DR1\\MTRR0\\"
audioFile = "SI918.WAV"
#
#pathName = "C:\\Data\\TIMIT\\Data\\TEST\\DR1\\FJEM0\\"
#audioFile = "SX364.WAV"
#
# load a sample audio file