signal-processing

Convolution of multiple 1D signals in a 2D matrix with multiple 1D kernels in a 2D matrix

♀尐吖头ヾ 提交于 2019-12-07 20:26:52
问题 I have a randomly defined H matrix of size 600 x 10 . Each element in this matrix H can be represented as H(k,t) . I obtained a speech spectrogram S which is 600 x 597 . I obtained it using Mel features, so it should be 40 x 611 but then I used a frame stacking concept in which I stacked 15 frames together. Therefore it gave me (40x15) x (611-15+1) which is 600 x 597 . Now I want to obtain an output matrix Y which is given by the equation based on convolution Y(k,t) = ∑ H(k,τ)S(k,t-τ) . The

How to average a signal to remove noise with Python

南楼画角 提交于 2019-12-07 18:51:42
问题 I am working on a small project in the lab with an Arduino Mega 2560 board. I want to average the signal (voltage) of the positive-slope portion (rise) of a triangle wave to try to remove as much noise as possible. My frequency is 20Hz and I am working with a data rate of 115200 bits/second (fastest recommended by Arduino for data transfer to a computer). The raw signal looks like this: My data is stored in a text file, with each line corresponding to a data point. Since I do have thousands

What is the correct method to upsample?

自古美人都是妖i 提交于 2019-12-07 18:28:02
问题 I have an array of samples at 75 Hz, and I want to store them at 128 Hz. If it was 64 Hz and 128 Hz it was very simple, I would just double all samples. But what is the correct way if the samplerates are not a fraction of eachother? 回答1: When you want to avoid Filtering then you can: handle signal as set of joined interpolation cubics curves but this point is the same as if you use linear interpolation. Without knowing something more about your signal and purpose you can not construct valid

How should I implement accurate pitch-detection in Java for Android phones?

亡梦爱人 提交于 2019-12-07 16:02:26
问题 I want to develop an application that would require accurate pitch-detection for musical instruments through the Android phone's microphone. Most suggestions I read of involve using Fast Fourier Transforms (FFT), but they mentioned it having issues with accuracy and processing power (considering it should run smoothly on a smartphone). One answer suggested a 5Hz error margin, which would be quite noticeable in the low frequency tone range. If the error is logarithmic rather than static in

20hz-20000hz Butterworth filtering exploding

房东的猫 提交于 2019-12-07 15:28:27
I want to filter out everything outside 20 Hz - 20000 Hz. I'm using a Butterworth filter: from scipy.io import wavfile from scipy import signal import numpy sr, x = wavfile.read('sweep.wav') nyq = 0.5 * sr b, a = signal.butter(5, [20.0 / nyq, 20000.0 / nyq], btype='band') x = signal.lfilter(b, a, x) x = numpy.float32(x) x /= numpy.max(numpy.abs(x)) wavfile.write('b.wav', sr, x) I've noticed that it works with a 44.1 khz file, but not with a 96 khz WAV file ( demo file here ) (it's not an audio I/O problem): the output is either blank (silence) or exploding (with some other input wav files). 1)

“32 bit float mono audio” in Jack

孤街醉人 提交于 2019-12-07 13:20:18
问题 I was playing with Jack, and I noticed that the default audio type JACK_DEFAULT_AUDIO_TYPE is set to "32 bit float mono audio". I'm a bit confused: IEEE defines 32-bit C float range approximately from 3.4E–38 to 3.4E+38, and I was wondering what is the maximum and minimum "undistorted" amplitude that a jack_default_audio_sample_t can hold with that audio type. For example, if some DSP algorithm gives me samples in the range [0,1], how can I correctly convert between them and Jack's format?

Compute EWMA over sparse/irregular TimeSeries in Pandas

孤街醉人 提交于 2019-12-07 13:19:00
问题 Given the following high-frequency but sparse time series: #Sparse Timeseries dti1 = pd.date_range(start=datetime(2015,8,1,9,0,0),periods=10,freq='ms') dti2 = pd.date_range(start=datetime(2015,8,1,9,0,10),periods=10,freq='ms') dti = dti1 + dti2 ts = pd.Series(index=dti, data=range(20)) I can compute an exponentially weighted moving average with a halflife of 5ms using a pandas function as follows: ema = pd.ewma(ts, halflife=5, freq='ms') However, under the hood, the function is resampling my

How to implement IIR Band-Pass Filter for an input audio in Android

不想你离开。 提交于 2019-12-07 11:41:34
问题 How do I implement an IIR bandpass filter in my current android code? I have an android app which could record audio (frequency actually) and save it in a .wav file. I have managed to find a IIR Filter Library online but I am not sure how to implement it into my code. https://github.com/ddf/Minim/blob/master/src/ddf/minim/effects/BandPass.java https://github.com/DASAR/Minim-Android/blob/master/src/ddf/minim/effects/IIRFilter.java I am supposed to add the 18k-20k bandpass filter to the code

Converting from samplerate/cutoff frequency to pi-radians/sample in a discrete time sampled IIR filter system

徘徊边缘 提交于 2019-12-07 08:00:35
问题 I am working on doing some digital filter work using Python and Numpy/Scipy. I'm using scipy.signal.iirdesign to generate my filter coefficents, but it requires the filter passband coefficents in a format I am not familiar with wp, ws : float Passband and stopband edge frequencies, normalized from 0 to 1 (1 corresponds to pi radians / sample). For example: Lowpass: wp = 0.2, ws = 0.3 Highpass: wp = 0.3, ws = 0.2 (from here) I'm not familiar with digital filters (I'm coming from a hardware

Need Android equivalent of AudioInputStream

 ̄綄美尐妖づ 提交于 2019-12-07 06:33:24
问题 I'm trying to write an Android app that analyzes content from the user's music library. Let's assume that these are mp3 files on the SD drive, for starters. I'm able to find Java algorithms to analyze music files, but I can't find an API to read and decode the files (not play them. There's an API to play the files, and even classes for audio effects, but I don't see any way for an app to get to the decoded data from a music file. I can read from microphone. J2SE has a class AudoInputStream