signal-processing

fspecial alternatives for Gaussian filter

余生颓废 提交于 2019-12-11 15:11:13
问题 I am attempting to use a MATLAB script that requires the use of the Image Processing Toolbox function fspecial() . I do not have the Image Processing Toolbox, but do have the Signal Processing Toolbox which contains suite of tools for the creation of filters. Sadly, I am largely ignorant on filter creation and am looking to see if I can get some help determining if I can replicate the following line of code using the filter creation tools in the Signal Processing Toolbox: fspecial('gaussian',

Fitting a sum of functions with fixed parameter in python

好久不见. 提交于 2019-12-11 12:12:57
问题 The signal I want to fit is a superposition of multiple sine-functions (and noise) and I want to fit for all frequencies simultaneously. Here an example data file, generated with two frequencies of 240d^-1 and 261.8181d^-1: https://owncloud.gwdg.de/index.php/s/JZQTJ3VMYZH8qNB and plot of the time series (excerpt) So far I can fit one sine-function after the other, while keeping the frequency fixed to a value. I get the frequency from e.g. a periodogram and in the end I am interested in

Auto-correlating the cepstrum

*爱你&永不变心* 提交于 2019-12-11 12:06:20
问题 I'm trying to detect some echoes in sound coming from the microphone. The echoes will be periodic and at one of two possible offsets. I've heard I need to auto-correlate the cepstrum of the signal in order to detect the presence of these echoes. Can you provide code using the Accelerate framework that shows how to detect echoes in the audio data? 回答1: I'm not entirely sure why you'd auto correlate the cepstrum. Auto correlation, though, gives you a representation that is related to the

Number of Zero-crossings - Equation

梦想与她 提交于 2019-12-11 11:55:21
问题 I have written an algorithm that calculates the number of zero-crossings within a signal. By this, I mean the number of times a value changes from + to - and vice-versa. The algorithm is explained like this: If there are the following elements: v1 = {90, -4, -3, 1, 3} Then you multiply the value by the value next to it. (i * i+1) Then taking the sign value sign(val) determine if this is positive or negative. Example: e1 = {90 * -4} = -360 -> sigum(e1) = -1 e2 = {-4 * -3} = 12 -> signum(e2) =

IIR Lowpass filter in C# breaks in x86 mode

守給你的承諾、 提交于 2019-12-11 11:16:55
问题 I'm trying to use a IIR LP filter in C#. It is a 5th order Butterworth filter. The code works in 64Bit mode but breaks in 32Bit mode. Debugging showed, that the parameters are slightly different and the output raises to infinity/NAN. I am using doubles for the calculation and storing. The correct parameters a[i],b[i] are: -5 -4,9792522401964 10 9,91722403267282 -10 -9,87615728025693 5 4,91765142871949 -1 -0,979465940928259 The 32Bit calculation gets these: -5 -4,97925281524658 10 9

Detecting Seasonality in R

自古美人都是妖i 提交于 2019-12-11 11:15:31
问题 Problem: Detecting cyclical patterns in daily data using periodogram and FFT in R. The issue is how to code in R the periodogram to detect monthly, quarterly, semi-annual, annual..etc cyclical patterns in the data. In other words I need to detect the existence of cyclical patterns for low frequencies ( ie: 1 year=> 2*pi/365, 6 months = > 4*pi/365, etc) Reproducible Example: library(weatherData) w2009=getWeatherForYear("sfo",2009) w2010=getWeatherForYear("sfo",2010) w2011=getWeatherForYear(

FFT in Excel — How to Obtain the Most Realistic Spectrum

空扰寡人 提交于 2019-12-11 11:06:40
问题 I’m trying to obtain the FFT spectrum of these data: gggttt.host.sk/sample.xls using Excel. @Paul R helped me a lot in another question to figure out the meaning of bins but there are still questions which I’d like to understand. First, Excel, even when the moduli are represented in log scale, does not show them in dB. What do you do to have these magnitudes converted to dB? Further, there’s a concern about the window function, aliasing etc. Since I’m crunching data from exactly one period,

Median of arbitrary datapoint around index - MATLAB

旧街凉风 提交于 2019-12-11 10:03:40
问题 I've been using the findpeaks function with great success to detect peaks in my signal. My next step is to clean these identified peaks, for which I have the indices. My goal is to calculate the median of Y data points before and Y data points after a given index and replace whatever values (noise) there are with these new values (the calculated median). Something like this: % points before, peak, points after % ↓ ↓ ↓ x = [1, 2, 3, 1, 34, 3, 2, 1, 3] Calculate the median of the 4 data points

Reading .wav file in Matlab Coder

别等时光非礼了梦想. 提交于 2019-12-11 08:45:39
问题 I want to read an audio file with matlab coder . The problem is that wavread() is not supported, but as this is a pretty essential part of any audio coding I am thinking that there must be another way to achieve this? Any ideas? 回答1: What is your use case? If you really just want to run the generated code in a MEX-function within MATLAB you can use coder.extrinsic to call wavread. This will not work outside of the MATLAB environment. Outside the MATLAB environment, you will need to use custom

How to automatically silence sections of audio below a given volume threshold?

て烟熏妆下的殇ゞ 提交于 2019-12-11 08:37:29
问题 I'm coding a monophonic music transcription application using C#. I want to silence all parts of a WAV file below a certain volume threshold. Any idea how to do this? 回答1: You need a Noise Gate. A noise gate is a type of audio effect that silences (or reduces in volume) any quiet sections that fall below a set volume threshold. It would probably be easier to use an existing noise gate implementation rather then create your own. Understanding and implementing a basic noise gate isn't too