signal-processing

How to obtain sound envelope using python?

血红的双手。 提交于 2020-01-23 01:43:45
问题 Hello I new with python and also with sound signal analysis. I am trying to get the envelope of a birth song (zebra finch). It has a very rapid signal fluctuations and I tried with different approach. For instance I tried to plot the signal and get the envelope with the following code base on other examples that I found (I added comments on the code to understand it): #Import the libraries from pylab import * import numpy import scipy.signal.signaltools as sigtool import scipy, pylab from

Real-time peak detection in noisy sinusoidal time-series

。_饼干妹妹 提交于 2020-01-22 10:27:25
问题 I have been attempting to detect peaks in sinusoidal time-series data in real time , however I've had no success thus far. I cannot seem to find a real-time algorithm that works to detect peaks in sinusoidal signals with a reasonable level of accuracy. I either get no peaks detected, or I get a zillion points along the sine wave being detected as peaks. What is a good real-time algorithm for input signals that resemble a sine wave, and may contain some random noise? As a simple test case,

Hanning (von Hann) window

让人想犯罪 __ 提交于 2020-01-21 21:50:05
问题 public short[] HanningWindow(short[] signal_in ,int pos ,int size) { for (int i= pos; i < pos+size; i++) { signal_in[i] = (short) ((signal_in[i]) * ( 0.5 * (1-Math.cos( (2 * Math.PI * i) / (size - 1))))) ; } return signal_in; } I am trying to use it over pos = (ring+delay*frame_rate*frame_size)%(frame_size*(frame_rate+1)); num = record.read(lin,pos,frame_size); GGSpecSub tempSpecSub = new GGSpecSub(); lin = tempSpecSub.HanningWindow(lin, pos, frame_size); It's my first time using real-time

Hanning (von Hann) window

こ雲淡風輕ζ 提交于 2020-01-21 21:49:12
问题 public short[] HanningWindow(short[] signal_in ,int pos ,int size) { for (int i= pos; i < pos+size; i++) { signal_in[i] = (short) ((signal_in[i]) * ( 0.5 * (1-Math.cos( (2 * Math.PI * i) / (size - 1))))) ; } return signal_in; } I am trying to use it over pos = (ring+delay*frame_rate*frame_size)%(frame_size*(frame_rate+1)); num = record.read(lin,pos,frame_size); GGSpecSub tempSpecSub = new GGSpecSub(); lin = tempSpecSub.HanningWindow(lin, pos, frame_size); It's my first time using real-time

Splitting a DTMF signal from a wav file using Matlab

别等时光非礼了梦想. 提交于 2020-01-21 09:53:47
问题 Here is the context of the problem: I have a DTMF signal in wav format, I have to identify the number sequence it has encoded. I must do so using fast fourier transform in Matlab, implying that I read the wav file using wavread and to identify each number that is seperated by 40ms silence or more. Here is my code so far: [signal, fs] = wavread( 'C:\Temp\file.wav' ); % here, fs = 8000Hz N = 512; T = 1/fs; L = length( signal ) samples = fs / 1000 * 40 windows = floor(L / samples) t = (1:L)/fs;

scipy.signal.spectrogram nfft parameter

情到浓时终转凉″ 提交于 2020-01-21 05:48:05
问题 What does nfft parameter mean in this function? Please refer to this link for the documentation https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.signal.spectrogram.html 回答1: scipy.signal.spectrogram works by splitting the signal into (partially overlapping) segments of time, and then computing the power spectrum from the Fast Fourier Transform (FFT) of each segment. The length of these segments can be controlled using the nperseg argument, which lets you adjust the trade-off

Pitch detection with computeSpectrum() return FFT values

无人久伴 提交于 2020-01-21 00:27:06
问题 I'm developing using Actionscript 3.0 for Flash Player 10.3 I'm using computeSpectrum() on a loaded .mp3 Running *Event.ENTER_FRAME* to get snapshots of each sample in an byteArray The ByteArray contains 512 values (256 for each channel). These values are FFT Spectrum, ranging from 0 to 1. I can't use the peak frequency for each of the samples (as I found found out!) because the highest value is not necessarily the fundamental frequency! As a result I'm getting lots of random values all over

Creating wave data from FFT data?

萝らか妹 提交于 2020-01-16 19:39:58
问题 As you might notice, i am really new to python and sound processing. I (hopefully) extracted FFT data from a wave file using python and the logfbank and mfcc function. (The logfbank seems to give the most promising data, mfcc output looked a bit weird for me). In my program i want to change the logfbank/mfcc data and then create wave data from it (and write them into a file). I didn't really find any information about the process of creating wave data from FFT data. Does anyone of you have an

Apply filtfilt on successive blocks with initial conditions (to avoid discontinuity)

余生长醉 提交于 2020-01-16 18:05:28
问题 We have two lowpass filters with a different cutoff value: b, a = signal.butter(2, 0.125) b2, a2 = signal.butter(2, 0.140) When applying the first filter to x[0:10000] and the second to x[10000:20000] with lfilter , we have to use initial conditions for the output to be "continuous", as seen here in the answer of Continuity issue when applying an IIR filter on successive time-frames: zi = lfilter_zi(b, a) x[0:10000], zi = lfilter(b, a, x[0:10000], zi=zi) x[10000:20000], zi = lfilter(b2, a2, x

How to implement a FIR high pass filter in Python?

落花浮王杯 提交于 2020-01-15 11:46:31
问题 First of all I asked this question in Stack Exchange and I am getting only concept related answers and not implementation oriented. So, my problem is I am trying to create high pass filter and I implemented using Python. from numpy import cos, sin, pi, absolute, arange from scipy.signal import kaiserord, lfilter, firwin, freqz, firwin2 from pylab import figure, clf, plot, xlabel, ylabel, xlim, ylim, title, grid, axes, show # Nyquist rate. nyq_rate = 48000 / 2 # Width of the roll-off region.