signal-processing

Audio Manipulation In C++

半腔热情 提交于 2019-12-12 09:52:52
问题 I hope this is the right place to post this and somebody can help. I am a music technology student and I've recently picked up learning C++ as it would greatly help my career knowing a programming language, especially this one since it is used in the video games industry. Anyways onto the main topic. What I want to create is a program (in C++) that lets the user load a 16bit linear PCM WAVE file. Then I want to manipulate the audio sample data within that wave file. I want to either remove

How do I perform a convolution in python with a variable-width Gaussian?

萝らか妹 提交于 2019-12-12 08:34:10
问题 I need to perform a convolution using a Gaussian, however the width of the Gaussian needs to change. I'm not doing traditional signal processing but instead I need to take my perfect Probability Density Function (PDF) and ``smear" it, based on the resolution of my equipment. For instance, suppose my PDF starts out as a spike/delta-function. I'll model this as a very narrow Gaussian. After being run through my equipment, it will be smeared out according to some Gaussian resolution. I can

Reimplement vDSP_deq22 for Biquad IIR Filter by hand

家住魔仙堡 提交于 2019-12-12 08:09:48
问题 I'm porting a filterbank that currently uses the Apple-specific (Accelerate) vDSP function vDSP_deq22 to Android (where Accelerate is not available). The filterbank is a set of bandpass filters that each return the RMS magnitude for their respective band. Currently the code (ObjectiveC++, adapted from NVDSP) looks like this: - (float) filterContiguousData: (float *)data numFrames:(UInt32)numFrames channel:(UInt32)channel { // Init float to store RMS volume float rmsVolume = 0.0f; // Provide

Estimate formants using LPC in Python

久未见 提交于 2019-12-12 07:52:30
问题 I'm new to signal processing (and numpy, scipy, and matlab for that matter). I'm trying to estimate vowel formants with LPC in Python by adapting this matlab code: http://www.mathworks.com/help/signal/ug/formant-estimation-with-lpc-coefficients.html Here is my code so far: #!/usr/bin/env python import sys import numpy import wave import math from scipy.signal import lfilter, hamming from scikits.talkbox import lpc """ Estimate formants using LPC. """ def get_formants(file_path): # Read from

Finding zero crossing that are going positive and zero crossing that are going negative

≡放荡痞女 提交于 2019-12-12 07:17:44
问题 I have a signal that I would like to copy when it: 1) starts at zero crossing going positive 2) copy a set number of points (like 8000) 3) and after the 8000 points are copied continue appending points until a zero crossing going down section is found. I can find the zero crossing but I'm having some issues with knowing how to tell when there is a zero crossing going positive and/or a zero crossing going negative. I'm also having trouble with adding the next section of points after the 8000

Python High Pass Filter

帅比萌擦擦* 提交于 2019-12-12 07:15:03
问题 I implemented an high pass filter in python using this code: from scipy.signal import butter, filtfilt import numpy as np def butter_highpass(cutoff, fs, order=5): nyq = 0.5 * fs normal_cutoff = cutoff / nyq b, a = butter(order, normal_cutoff, btype='high', analog=False) return b, a def butter_highpass_filter(data, cutoff, fs, order=5): b, a = butter_highpass(cutoff, fs, order=order) y = filtfilt(b, a, data) return y rawdata = np.loadtxt('sampleSignal.txt', skiprows=0) signal = rawdata fs =

Methodology of FFT for Matlab spectrogram / short time Fourier transform functions

时光怂恿深爱的人放手 提交于 2019-12-12 06:09:00
问题 I'm trying to figure out how MATLAB does the short time Fourier transforms for its spectrogram function (and related functions like specgram, or stft in Octave). What is curious to me is that you can apparently specify the length of the window and the FFT length (number of output frequencies) independently, whereas I would have expected that these two should be equal (since the length of an FFT'd signal is the same as the length of the original signal). To illustrate what I mean, here is the

NAudio WaspiLoopback Goertzel

余生长醉 提交于 2019-12-12 06:02:06
问题 Update #2: I kept messing more with the code, my only issue is that it is detecting frequencies when sound is present through the microphone but the algorithm is not working at all. I ask it for 500Hz and it'd output a power level even tough there was NO sound at that frequency. Code below (I have seen that this post haven't had much attention, thus why I'm updating constantly) private void button3_Click(object sender, EventArgs e) { waveIn = new WasapiLoopbackCapture(); waveIn.DataAvailable

Why there is discontinuity between the signals and the specified frequencies do not appear as stated

余生长醉 提交于 2019-12-12 03:25:31
问题 I have generated the non-stationary signals posted below in the image, and i have two questions: 1- Why the first signal x1 , shown in red, has only 4 peaks despite its frequency which is 15 in the equation at line-12 of code? 2- Why there is discontinuity between the signals shown? In other words, i expected the four signals to be linked smoothly and each signla starts where the previous one ends, but, that did not happens, and instead for an example, x1 ended at .25 and the x2 started at

GCC-PHAT cross correlation in Python

一世执手 提交于 2019-12-12 02:55:20
问题 I am trying to implement GCC-PHAT in python. The approach is similar to the following two links: link1 and link2 It seems the only difference between GCC-PHAT and normal cross-correlation using FFT is the division by the magnitude. Here is my code: import numpy as np import matplotlib.pyplot as plt from scipy.fftpack import rfft, irfft, fftfreq, fft, ifft def xcorr_freq(s1,s2): pad1 = np.zeros(len(s1)) pad2 = np.zeros(len(s2)) s1 = np.hstack([s1,pad1]) s2 = np.hstack([pad2,s2]) f_s1 = fft(s1)