signal-processing

Comparing Naive Inverse Filter to Wiener Filter for Deconvolution in Matlab

廉价感情. 提交于 2021-02-20 19:34:04
问题 I am currently trying to compare a simple inverse filter to the wiener filter for deconvolution using matlab. My starting signal is exp(-t^2) and this is to be convolved with a rect that is nonzero for times -.5 to .5. I am introducing noise with amplitude in the range -.5 to .5. Defining my time domain to frequency domain mapping: f = exp(-t^2) => F s = rect => R c = f*s => C r = noise (see above) => R with noise c becomes: c = f*s + n => C = FxS + N For the first approach I am simply taking

Extracting EEG Components from Signal within MATLAB

那年仲夏 提交于 2021-02-19 02:34:07
问题 I have a simple EEG signal in MATLAB such as that shown in the figure below. And what I wanted was to extract the components of the EEG according to the following table. Delta - up to 4 Hz; Theta - 4 -> 8 Hz Alpha - 8 -> 13 Hz Beta - 13 -> 30 Hz Gamma - 30 -> 100 Hz In a first attempt to solve this problem I tried to build a bandpass filter with 'fdatool' from MATLAB to extract the component' theta 'signal, but without success. Along attached the code for the filter obtained with the 'fdatool

Detect specific sound in audio

╄→尐↘猪︶ㄣ 提交于 2021-02-11 11:50:31
问题 I have a short (~1 second) arbitrary sound file and two devices. At some unknown time, device 1 will play the sound file out of its speaker. Device 2 should then be able to detect that sound. There may be background noise. It's unknown how loud the sound will be played. This feels like it should be a common solved problem, but searching for answers has left me with nothing. If anyone has good a solution or could just point me in the right direction I'd be very grateful. 回答1: In most distance

ValueError: could not broadcast input array from shape (20,590) into shape (20)

一个人想着一个人 提交于 2021-02-10 06:37:07
问题 I am trying to extract features from .wav files by using MFCC's of the sound files. I am getting an error when I try to convert my list of MFCC's to a numpy array. I am quite sure that this error is occurring because the list contains MFCC values with different shapes (But am unsure of how to solve the issue). I have looked at 2 other stackoverflow posts, however these don't solve my problem because they are too specific to a certain task. ValueError: could not broadcast input array from

sklearn dimensionality issues “Found array with dim 3. Estimator expected <= 2”

倖福魔咒の 提交于 2021-02-09 11:13:22
问题 I am trying to use KNN to correctly classify .wav files into two groups, group 0 and group 1. I extracted the data, created the model, fit the model, however when I try and use the .predict() method I get the following error: Traceback (most recent call last): File "/..../....../KNN.py", line 20, in <module> classifier.fit(X_train, y_train) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/neighbors/base.py", line 761, in fit X, y = check_X_y(X, y,

sklearn dimensionality issues “Found array with dim 3. Estimator expected <= 2”

依然范特西╮ 提交于 2021-02-09 11:12:20
问题 I am trying to use KNN to correctly classify .wav files into two groups, group 0 and group 1. I extracted the data, created the model, fit the model, however when I try and use the .predict() method I get the following error: Traceback (most recent call last): File "/..../....../KNN.py", line 20, in <module> classifier.fit(X_train, y_train) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sklearn/neighbors/base.py", line 761, in fit X, y = check_X_y(X, y,

Third octave frequency spectrum with python

可紊 提交于 2021-02-08 06:56:41
问题 I am trying to get a third-octave frequency spectrum of a time signal. The time signal is the acoustic pressure of rotational rotor noise which is harmonic. Its fundamental frequency is ff = n * N_b and for that reason, all frequencies should be multiples of ff. Using fft I get the expected result: Multiples of the fundamental frequency are the relevant frequencies in the spectrum. To get the third-octave frequency spectrum I wanted to use python acoustics, but the result of the function

Detecting dips in a 2D plot

青春壹個敷衍的年華 提交于 2021-02-07 05:35:10
问题 I need to automatically detect dips in a 2D plot, like the regions marked with red circles in the figure below. I'm only interested in the "main" dips, meaning the dips have to span a minimum length in the x axis. The number of dips is unknown, i.e., different plots will contain different numbers of dips. Any ideas? Update: As requested, here's the sample data, together with an attempt to smooth it using median filtering, as suggested by vines. Looks like I need now a robust way to

Creating spectrogram from .wav using FFT in java

跟風遠走 提交于 2021-02-06 03:38:28
问题 After researching and a lot of trials-and-errors, I have come to a point that I can construct a spectrogram which I think it has element of rights and wrongs . 1. First, I read .wav file into a byte array and extract only the data part. 2. I convert the byte array into a double array which takes the average of right and left channels. I also notice that 1 sample of 1 channel consists of 2 bytes. So, 4 bytes into 1 double. 3. For a certain window size of power of 2, I apply FFT from here and

MPEG Audio Constant bit rate conversion

纵然是瞬间 提交于 2021-02-05 11:34:48
问题 I am trying to convert few .wav files to .mp3 format The desired .mp3 format is : I tried with FFmpeg with this code : ffmpeg -i input.wav -vn -ac 2 -b:a 160k output1.mp3 This is the output of this command on one .wav format I am getting the result but two things are different Overall bit rate mode and Writing library Writing library: LAME3.99.5 vs LAME3.100 ( I think this shouldn't make any problem?) bit rate mode Constant Vs variable How to change bit rate mode from variable to Constant?