signal-processing

sparse indexing in matlab

南笙酒味 提交于 2019-12-12 02:49:54
问题 I have a very long code which is full of the following "if"s and matlab editor gives me a suggestion as follow: this sparse indexing expression is likely to be slow mt = rand(200,200); [c r] = size(mt); T = sparse(r*c,2); for i = 1:c for j = 1:r if(ind(j,i)==1) templat = template + 1; T((i-1)*r+j,2)=100000; end end; end; Is there any way by which I can make the code faster and do the matlab's suggestion? (The code may not run, because I just picked a few lines and tried to show the issue) 回答1

How can I use Harmonic Product Spectrum algorithm for overtone rich monophonic pitch detection and estimation in Unity3D

狂风中的少年 提交于 2019-12-12 02:37:11
问题 How can I calculate the Fundamental frequency of microphone input audio signal using GetSpectrumData in Unity ? 来源: https://stackoverflow.com/questions/42694778/how-can-i-use-harmonic-product-spectrum-algorithm-for-overtone-rich-monophonic-p

Web audio analyser node - run at regular interval

人走茶凉 提交于 2019-12-12 02:27:55
问题 I want to detect an audio signal (morse code) on specific frequencies using web audio. I retrieve the frequency data using an analyser node's getFloatFrequencyData function. Now the problem: Using setInterval() to regularly sample the frequency data is not regular enough: the callback gets executed a few milliseconds earlier or later than expected. How can I retrieve the analyser's frequency data regularly exactly every few miliseconds? I would prefer using the built-in analyser node's FFT

How to calcuate the energy spectrum of a signal?

时光毁灭记忆、已成空白 提交于 2019-12-12 02:02:55
问题 I know by theory that the energy spectrum of a given signal is the sum of the squared fourier coefficient . What if I have the real and imaginary part of the corresponding fourier coefficient, can I say that energy spectrum of a given signal is equal to sum of (real part + imaginary part)^2 I hope that is straightforward what Im trying to say?! best regards ben 回答1: Not quite. You want: sum of fft_result_magnitudes^2 which is: sum of (sqrt(real_part^2 + imaginary_part^2)^2 which is: sum of

DTMF detection using Goertzel Algorithm

。_饼干妹妹 提交于 2019-12-11 19:47:57
问题 How can I use Goertzel Algorithm if the wave format are the following: - 2 Channels - 32 bit - 48 kHz I already searched about Goertzel algorithm but all I can see all over the internet is detection of DTMF with wave format of 2 Channels, 16 bit, and 8 kHz. I don't know what part of code should I modify to meet my requirements. Private Function Goertzel(ByVal sample As Byte(), ByVal N As Long, _ ByVal freq As Double, ByVal sampr As Long) As Double Dim Skn As Double = 0 Dim Skn1 As Double = 0

Finding R peak from a heart signal input from a stethoscope

倖福魔咒の 提交于 2019-12-11 17:51:20
问题 Given an heart beat signal measured using a stethoscope to the audio card of the computer through a hardware(mainly amplifier and low pass filter having cutoff frequency 100hz). Now the signal is filtered with cutoff 100hz..the code to find the peak and beats per minute is given below..The code works only for certain cases. Please help me find the mistake clear all %input the signal into matlab [x,fs]=wavread('heartbeat.wav'); figure(1) subplot(2,1,1) x1=x(:,2); plot(x1(500:10000),'r-');

What are the 13 MFCC features

我的未来我决定 提交于 2019-12-11 17:23:36
问题 I saw many places that uses 13 MFCC features to analyse wav files. I couldn't find any exploitation to what is the meaning of each feature? e.g what is the first MFCC feature, the second , etc. In particular, I couldn't find how to get the pitch (F0) from the MFCC features? Thanks 来源: https://stackoverflow.com/questions/54530052/what-are-the-13-mfcc-features

Frequency domain of a sine wave with frequency 1000Hz

☆樱花仙子☆ 提交于 2019-12-11 17:18:37
问题 I'm starting DSP on Python and I'm having some difficulties: I'm trying to define a sine wave with frequency 1000Hz I try to do the FFT and find its frequency with the following piece of code: import numpy as np import matplotlib.pyplot as plt sampling_rate = int(10e3) n = int(10e3) sine_wave = [100*np.sin(2 * np.pi * 1000 * x/sampling_rate) for x in range(0, n)] s = np.array(sine_wave) print(s) plt.plot(s[:200]) plt.show() s_fft = np.fft.fft(s) frequencies = np.abs(s_fft) plt.plot

Non-ASCII character '\xe2' in file but no encoding declared

血红的双手。 提交于 2019-12-11 17:16:32
问题 I wrote a script to extract signals from the MIT-BIH dataset using the wfdb python library. The script was working fine when I was running it on windows but I recently shifted to Mac . After installing all the dependencies I got an error when I tried to import processing from the wfdb library. This is the error I get: SyntaxError: Non-ASCII character '\xe2' in file /usr/local/lib/python2.7/site-packages/scipy/stats/_continuous_distns.py on line 3346, but no encoding declared; see http:/

Can not find Tesseract 4.0 tessdata only for Numbers

▼魔方 西西 提交于 2019-12-11 15:58:18
问题 As in this post: pytesseract using tesseract 4.0 numbers only not working Described, its possible to detect numbers with the eng.traineddata file but if I want to detect only numbers, this isn't possible with this file. Even if you define tessedit_char_whitelist=0123456789 it doesn't recognize anything. I searched on GitHub and so on to find a digit.traineddata for Tesseract 4.0 but didn't found one? Does someone know which one I could take? Is it possible to use one from Tesseract 3.x (but