audio-processing

Matlab real time audio processing

最后都变了- 提交于 2021-02-19 16:22:18
问题 I'm trying to record my microphone input and process it at the same time. I tried with a loop with this inside: recordblocking(recorder, 1); y = getaudiodata(recorder); % any processing on y But while I'm doing something with y , I'm losing information since not recording continuously. Is there something I could do to continuously record sound coming in my microphone, store it in some kind of buffer, and process chunks of it at the same time? A delay isn't a problem, but I really need the

Matlab real time audio processing

三世轮回 提交于 2021-02-19 16:21:54
问题 I'm trying to record my microphone input and process it at the same time. I tried with a loop with this inside: recordblocking(recorder, 1); y = getaudiodata(recorder); % any processing on y But while I'm doing something with y , I'm losing information since not recording continuously. Is there something I could do to continuously record sound coming in my microphone, store it in some kind of buffer, and process chunks of it at the same time? A delay isn't a problem, but I really need the

Matlab real time audio processing

£可爱£侵袭症+ 提交于 2021-02-19 16:21:11
问题 I'm trying to record my microphone input and process it at the same time. I tried with a loop with this inside: recordblocking(recorder, 1); y = getaudiodata(recorder); % any processing on y But while I'm doing something with y , I'm losing information since not recording continuously. Is there something I could do to continuously record sound coming in my microphone, store it in some kind of buffer, and process chunks of it at the same time? A delay isn't a problem, but I really need the

Correct way to Convert 16bit PCM Wave data to float

浪尽此生 提交于 2021-02-18 07:24:32
问题 I have a wave file in 16bit PCM form. I've got the raw data in a byte[] and a method for extracting samples, and I need them in float format, i.e. a float[] to do a Fourier Transform. Here's my code, does this look right? I'm working on Android so javax.sound.sampled etc. is not available. private static short getSample(byte[] buffer, int position) { return (short) (((buffer[position + 1] & 0xff) << 8) | (buffer[position] & 0xff)); } ... float[] samples = new float[samplesLength]; for (int i

Perceptual similarity between two audio sequences

不羁岁月 提交于 2021-02-05 20:04:49
问题 I would like to get some sort of distance measure between two pieces of audio. For example, I want to compare the sound of an animal to the sound of a human mimicking that animal, and then return a score of how similar the sounds were. It seems like a difficult problem. What would be the best way to approach it? I was thinking to extract a couple of features from the audio signals and then do a Euclidian distance or cosine similarity (or something like that) on those features. What kind of

Mixing two16-bit encoded stereo PCM samples causing noise and distortion in the resulting audio

别等时光非礼了梦想. 提交于 2021-01-27 21:35:59
问题 I get two different audio samples from two sources. For microphone sound: audioRecord = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, 44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, (AudioRecord.getMinBufferSize(44100, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT)*5)); For Internal sound: audioRecord = new AudioRecord.Builder() .setAudioPlaybackCaptureConfig(config) .setAudioFormat(new AudioFormat.Builder() .setEncoding(AudioFormat.ENCODING_PCM

Find sound effect inside an audio file

爷,独闯天下 提交于 2020-07-16 08:15:13
问题 I have a load of 3 hour MP3 files, and every ~15 minutes a distinct 1 second sound effect is played, which signals the beginning of a new chapter. Is it possible to identify each time this sound effect is played, so I can note the time offsets? The sound effect is similar every time, but because it's been encoded in a lossy file format, there will be a small amount of variation. The time offsets will be stored in the ID3 Chapter Frame MetaData. Example Source, where the sound effect plays

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.