signal-processing

in-place bit-reversed shuffle on an array

大城市里の小女人 提交于 2019-12-17 15:53:07
问题 For a FFT function I need to permutate or shuffle the elements within an array in a bit-reversed way. That's a common task with FFTs because most power of two sized FFT functions either expect or return their data in a bit-reversed way. E.g. assume that the array has 256 elements I'd like to swap each element with it's bit-reversed pattern. Here are two examples (in binary): Element 00000001b should be swapped with element 10000000b Element 00010111b should be swapped with element 11101000b

Determine frequency from signal data in MATLAB

一世执手 提交于 2019-12-17 15:46:29
问题 I have data from a sensor and I need to find the frequency of it. It looks like fft() seems to be the way to go, but the MATLAB docs only show how to get a graph of the frequencies, I don't know what to do from there. Here's what my data looks like: 回答1: One way to go is indeed to use an fft. Since the fft gives you the frequency representation of the signal, you want to look for the maximum, and since the fft is a complex signal, you will want to take the absolute value first. The index will

How to convert pcm samples in byte array as floating point numbers in the range -1.0 to 1.0 and back?

独自空忆成欢 提交于 2019-12-17 15:17:32
问题 The resampling algorithm i use expects float array containing input samples in the range -1.0 to 1.0 . The audio data is 16 bit PCM with samplerate 22khz . I want to downsample the audio from 22khz to 8khz, how to represent the samples in byte array as floating point numbers >= -1 and <= 1 and back to byte array? 回答1: You ask two questions: How to downsample from 22kHz to 8kHz? How to convert from float [-1,1] to 16-bit int and back? Note that the question has been updated to indicate that #1

Android 2.3 Visualizer - Trouble understanding getFft()

浪尽此生 提交于 2019-12-17 12:16:53
问题 First time here so sorry in advance for any butchered formatting. So I am completely new to DSP so I have only a very general understanding of the Fourier Transform. I am trying to build a visualizer app for Android SDK 9, which includes a Visualizer class in android.media.audiofx.Visualizer http://developer.android.com/reference/android/media/audiofx/Visualizer.html The javadoc for the method getFft(), which is what I am using states: "Returns a frequency capture of currently playing audio

Real-time pitch detection using FFT [closed]

孤人 提交于 2019-12-17 10:29:29
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm trying to do real-time pitch detection using C++. I'm testing some code from performous (http://performous.org/), because everything else hasn't worked for me. I know for sure that this works, but i just cant get it to work. I've been trying this for a few weeks now, and I haven't been able to get any pitch

Detecting the fundamental frequency [closed]

喜夏-厌秋 提交于 2019-12-17 10:29:12
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . There's this tech-festival in IIT-Bombay, India, where they're having an event called "Artbots" where we're supposed to design artbots with artistic abilities. I had an idea about a musical robot which takes a song as input, detects the notes in the song and plays it back on a

DSP - Filtering in the frequency domain via FFT

微笑、不失礼 提交于 2019-12-17 10:22:26
问题 I've been playing around a little with the Exocortex implementation of the FFT, but I'm having some problems. Whenever I modify the amplitudes of the frequency bins before calling the iFFT the resulting signal contains some clicks and pops, especially when low frequencies are present in the signal (like drums or basses). However, this does not happen if I attenuate all the bins by the same factor. Let me put an example of the output buffer of a 4-sample FFT: // Bin 0 (DC) FFTOut[0] = 0

Sweep / chirp signal ends at incorrect frequency

一个人想着一个人 提交于 2019-12-17 09:57:42
问题 I'm creating a sweep / chirp signal using matlab / octave and my ending signal seems to be ending at the wrong frequency. How can I fix it so that the signal ends at the correct frequency. PS: I can't use the chirp command in octave because I'm creating a chirp / sweep signal using a specific equation. Example code with simple equation. and plot of problem %test sweep / chirp clear all,clc freq1=20; %start freq freq2=200; %end freq fs=44100; dur=1; %duration of signal in seconds t = linspace

How to apply a low-pass or high-pass filter to an array in Matlab?

痞子三分冷 提交于 2019-12-17 09:35:51
问题 Is there an easy way to apply a low-pass or high-pass filter to an array in MATLAB? I'm a bit overwhelmed by MATLAB's power (or the complexity of mathematics?) and need an easy function or some guidance as I couldn't figure it out from the documentation or searching the web. 回答1: Look at the filter function. If you just need a 1-pole low-pass filter, it's xfilt = filter(a, [1 a-1], x); where a = T/τ, T = the time between samples, and τ (tau) is the filter time constant. Here's the

Remove noise from wav file, MATLAB

狂风中的少年 提交于 2019-12-17 08:54:12
问题 I've only used MATLAB as a calculator, so I'm not as well versed in the program. I hope a kind person may be able to guide me on the way since Google currently is not my friend. I have a wav file in the link below, where there is a human voice and some noise in the background. I want the noise removed. Is there anyone who can tell me how to do it in MATLAB? https://www.dropbox.com/s/3vtd5ehjt2zfuj7/Hold.wav 回答1: This is a pretty imperfect solution, especially since some of the noise is