fft

Sound recognition for Phonegap

六眼飞鱼酱① 提交于 2021-01-29 04:15:04
问题 I am creating an Android application using Phonegap. I would like to record a sound (for example, a doorbell), and detect if that sound is heard again. Is there any sound recognition plugin for Phonegap? If not, how can I access the frequencies of the recorded sound (for example, in an array), so I can manually write an algorithm to compare the two audio files? Is there any audio format which stores data in that form? Thank you 来源: https://stackoverflow.com/questions/39315104/sound

Python Audio fftpack: Filter noise signal and graph it?

强颜欢笑 提交于 2021-01-29 03:57:40
问题 So I'm follow a tutorial where we create a signal and filter the noise using fftpack. Problem 1: I'm trying to plot the filtered and unfiltered signal noise on a graph so that I can see them side by side. Getting error: Warning (from warnings module): File "C:\Python39\lib\site-packages\numpy\core_asarray.py", line 83 return array(a, dtype, copy=False, order=order) ComplexWarning: Casting complex values to real discards the imaginary part I think this is causing the error: y = sig x = time

FFT Multiple 1d transforms using FFTW

自作多情 提交于 2021-01-28 19:41:35
问题 I have a 3-dimensional array U(z,y,x) and I want to perform a complex Fourier transform in z for all values of y and x. I am planning to use the FFTW library. I figured out from the FFTW manual that there is a way to perform multiple 1d transforms at once(mentioned below). CALL dfftw_plan_many_dft(PLAN, rank, n, howmany, in, inembed, istride, idist, out, onembed, ostride, odist, FFTW_MEASURE) I don't clearly understand what inembed and outembed means. Could you provide more insight into this

DTMF detection from a wav file

孤人 提交于 2021-01-28 05:40:39
问题 I'm an engineering student and I have to solve an academic problem regarding signal processing. Basically, given an DTMF signal in wav format, I have to identify the number sequence it has encoded. I must do so using discrete fourier transform analysis in Matlab environment, to build a script that reads the wav file and through the process identifies the numbers in the dial tone. I'm having trouble in the sense that I'm not really confortable with the Matlab environment and the whole discrete

Plotting Fourier Transform Of A Sinusoid In Python

笑着哭i 提交于 2021-01-28 03:57:25
问题 The following python program plots a sinusoid: import matplotlib.pyplot as plt import numpy as np # Canvas plt.style.use("ggplot") # Frequency, Oscillations & Range f = int(input("Enter frequency: ")) n_o = int(input("Enter number of oscillations: ")) t_max = n_o/f t = np.linspace(0, t_max, 1000) # Sine y_sin = np.sin(2*np.pi*f*t) # Setting subplots on separate axes fig, axs = plt.subplots(2, 1, constrained_layout = True) # Sine axis axs[0].plot(t, y_sin, color = "firebrick", label = "sin({

Problem plotting an image's Fourier transforms. “ValueError: x and y can be no greater than 2-D, but have shapes (2592,) and (2592, 1, 3)”

谁说胖子不能爱 提交于 2021-01-27 21:12:56
问题 I'm trying to get the fft of an image and then plot the fraq of that fft with using matplotlib. However, this error message: "ValueError: x and y can be no greater than 2-D, but have shapes (2592,) and (2592, 1, 3)". I tried to reshape my np.array like so: import numpy as np from PIL import Image import matplotlib.pyplot as plt import tkinter from scipy.fftpack import fft, fft2, fftshift resim = Image.open(r'yeni.jpg') resim_data = np.asarray(resim) fourier = fft2(resim_data) #psd2D = np.abs

Getting the frequencies associated with STFT in Librosa

青春壹個敷衍的年華 提交于 2021-01-27 12:52:14
问题 When using librosa.stft() to calculate a spectrogram, how does one get back the associated frequency values? I am not interested in generating an image as in librosa.display.specshow , but rather I want to have those values in hand. y, sr = librosa.load('../recordings/high_pitch.m4a') stft = librosa.stft(y, n_fft=256, window=sig.windows.hamming) spec = np.abs(stft) spec gives me the 'amplitude' or 'power' of each frequency, but not the frequencies bins themselves. I have seen that there is a

STFT understanding using librosa

╄→尐↘猪︶ㄣ 提交于 2021-01-25 07:00:51
问题 I have an audio sample of about 14 seconds in 8khz Sample Rate. Im using librosa to extract some features from this audio file. y, sr = librosa.load(file_name) stft = np.abs(librosa.stft(y, n_fft=n_fft)) # file_length = 14.650022675736961 #sec # defaults # n_fft =2048 # hop_length = 512 # win_length/4 = n_fft/4 = 512 (win_length = n_fft default) #windowsTime = n_fft * Ts # (1/sr) stft.shape # (1025, 631) Specshow : librosa.display.specshow(stft, x_axis='time', y_axis='log') [![stft sr = 22050

STFT understanding using librosa

浪尽此生 提交于 2021-01-25 07:00:35
问题 I have an audio sample of about 14 seconds in 8khz Sample Rate. Im using librosa to extract some features from this audio file. y, sr = librosa.load(file_name) stft = np.abs(librosa.stft(y, n_fft=n_fft)) # file_length = 14.650022675736961 #sec # defaults # n_fft =2048 # hop_length = 512 # win_length/4 = n_fft/4 = 512 (win_length = n_fft default) #windowsTime = n_fft * Ts # (1/sr) stft.shape # (1025, 631) Specshow : librosa.display.specshow(stft, x_axis='time', y_axis='log') [![stft sr = 22050

Python audio: Removing noise from a signal

≯℡__Kan透↙ 提交于 2021-01-07 02:52:39
问题 In the code, first I'm opening wav file called output_test.wav. I then filter the noise from the signal using fftpack. Problem : I'm trying to convert the filtered signal i.e. filtered_sig array into wav file properly. Currently when i open TestFiltered.wav I get the error: "The item was encoded into a format not supported: 0xc00d5212" Upon further investigation it seems i'm not filtering noise correctly? I think the error comes from the last 2 lines: filteredwrite = np.fft.irfft(filtered_sig