signal-processing

DSP - get the amplitude of all the frequencies

巧了我就是萌 提交于 2019-12-11 04:07:53
问题 this question is related to : DSP : audio processing : squart or log to leverage fft? in which I was lost about the right algorithm to choose. Now, Goal : I want to get all the frequencies of my signal, that I get from an audio file. Context: I use numpy, and scikits.audiolab. I made a lot of reading on the dsp subject, went to dspguru.com as well, read papers and nice blogs over the net. The code I use is this one : import numpy as np from scikits.audiolab import Sndfile f = Sndfile('first

Spectral Subtraction in Java - using JMathLib

风流意气都作罢 提交于 2019-12-11 03:42:52
问题 i'm new to Android and DSP. i'm implementing the Spectral Subtraction algorithm thanks my goal is to use this algorithm over a phone call stream buffer i'm trying to figure how to implement this code from the Matlab implementation of Spectral Subtraction i am using. Matalb code: function Seg=segment(signal,W,SP,Window) % SEGMENT chops a signal to overlapping windowed segments % A= SEGMENT(X,W,SP,WIN) returns a matrix which its columns are segmented % and windowed frames of the input one

How to convert a byte array into an AudioInputStream in Java

孤街醉人 提交于 2019-12-11 03:37:23
问题 I want to convert a byte array into an AudioInputStream. The byte array was filled from a *.wav file before. I have the following code: public static AudioInputStream writeBytesBackToStream(byte[] bytes) { ByteArrayInputStream baiut = new ByteArrayInputStream(bytes); AudioInputStream stream = null; try { stream = AudioSystem.getAudioInputStream(baiut); } catch (UnsupportedAudioFileException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } if(stream.equals(null) ||

phase unwrap issue (the unwrapping of the phases is not correcly)?

风格不统一 提交于 2019-12-11 01:44:37
问题 I have an issue regard to the unwrapping of phases over time. I have a radar which monitors a slow periodic moving object. From the received signal, i want to see the phase of the object over time. The phase-over-time signal is extracted from FFTs (at the same FFT bin for all the FFTs). Here is the result i got: Because the phases are wrapped, so I need to do an unwrapping for the phases. I use the Matlab command " unwrap " to to this. So I got: The issue is marked at the red circle. Here I

Working with a severely limited interpreted language

橙三吉。 提交于 2019-12-11 01:37:11
问题 I'm coding in an embedded language called JS. I want to be able to call three functions in any order. (ABC, ACB, BAC, BCA, CBA, CAB.) The trick? The language doesn't have user-defined functions. It does have a conditional and a looping construct. I think I have three choices. Duplicate a whole bunch of code. Write a preprocessor (that would create all the duplicated code). Do a loop with three iterations, using an array to control which functionality gets called on each pass of the loop. I

Can you compute the amplitude/power of original signal from Fourier transform?

谁都会走 提交于 2019-12-11 01:28:03
问题 After taking the Discrete Fourier Transform of some samples with scipy.fftpack.fft() and plotting the magnitude of these I notice that it doesn't equal the amplitude of the original signal. Is there a relationship between the two? Is there a way to compute the amplitude of the original signal from the Fourier coefficients without reversing the transform? Here's an example of sin wave with amplitude 7.0 and fft amplitude 3.5 from numpy import sin, linspace, pi from pylab import plot, show,

How to find the frequency from FFT data in MATLAB

旧巷老猫 提交于 2019-12-10 23:55:55
问题 From the question: How do I obtain the frequencies of each value in an FFT? I have a similar question. I understand the answers to the previous question, but I would like further clarification on frequency. Is frequency the same as the index? Let's go for an example: let's assume we have an array (1X200) of data in MATLAB. When you apply 'abs(fft)' for that array it gives the same size array as the result (1X200). So, does this mean this array contains magnitude? Does this mean the indices of

Implementation of the Discrete Fourier Transform - FFT

倖福魔咒の 提交于 2019-12-10 23:07:33
问题 I am trying to do a project in sound processing and need to put the frequencies into another domain. Now, I have tried to implement an FFT, that didn't go well. I tried to understand the z -transform, that didn't go to well either. I read up and found DFT's a lot more simple to understand, especially the algorithm. So I coded the algorithm using examples but I do not know or think the output is right. (I don't have Matlab on here, and cannot find any resources to test it) and wondered if you

i am trying to write a code to cross correlate a transmitted signal with a received signal to determine the number of samples delay

断了今生、忘了曾经 提交于 2019-12-10 21:35:43
问题 Cross correlation is to be used to measure distance to an aircraft by transmitting a known wide-band signal and correlating the transmitted signal with incoming signals received via the radar reception dish The transmitted signal x(n) is of length N=512 while the received signal y(n) is of length N=2048. y(n)=kx(n-d)+w(n); where 'kx(n-d)' is x(n) delayed by d samples and attenuated by a factor k, and w(n) is reception noise. i am trying to write a MATLAB program to cross correlate x(n) with

Mixing PCM audio samples

和自甴很熟 提交于 2019-12-10 19:17:00
问题 I have a simple question regarding mixing multiple PCM samples. I read that best way to mix multiple audio PCM samples is to take the average of the samples each frame. So if I am adding together say 5 16 bit samples before dividing by 5, there is obviously a good chance it will have a value greater than a 16bit short can hold. So when mixing together multiple 16 bit samples, do I store them all in int first and add them and average them, then convert back to short? 回答1: If you want to mix