signal-processing

units on x axis after FFT

我与影子孤独终老i 提交于 2019-12-08 09:48:09
问题 My signal is a static 1D pattern detected by the linear photodiode array with N pixels and pitch p. What units will I get along the X-axis after FFT to spectrum? 回答1: If you have a signal f(x) with unit U depending on variable x with unit V. Then the continuous Fourier transform of f has unit UV and depends on a variable with unit 1/V. Example 1: f(x) is a Voltage with x being time. then the Fourier transform has unit Vs (or V/Hz) versus variable 1/s (or Hz). Example 2: f(x) is a power with x

Using interpolation and repmat to change frequency of signal in octave and matlab

与世无争的帅哥 提交于 2019-12-08 09:39:51
问题 I'm using Octave 3.8.1 which is like matlab, I'm trying to use interpolation and repmat to alter the frequency of signals ( since it's so fast doing it this way (.01 seconds) and I have to create 28000+ at a time ) I can change the variable num_per_sec to any whole number but if I try to change it to 2.1 or anything with a decimal in it I get an error "error: reshape: can't reshape 44100x2 array to 92610x1 array error: called from: line 10 (the repmat line)" does anyone have a work around for

Time stretching signal / porting python code to matlab / octave

[亡魂溺海] 提交于 2019-12-08 09:28:56
问题 I'm trying to port over paulstretch's signal stretching over to matlab / octave. https://github.com/paulnasca/paulstretch_python See workflow i'm following below I can separate the signals into frequencies, amplitude and phase and join them back using the code below. I'm having issues porting over the windowing segments, overlapping, and extending the signals. Any ideas? Example matlab / octave code: freq=[0;0.534974;1.06995;1.60492;2.1399] amp1=[3.94414e-19;1.20523e-05;5.08643e-06;4.22469e

C++ api for understanding tone signals on a phone line

Deadly 提交于 2019-12-08 09:10:48
问题 Is there any good c++ source codes or api for handling phone lines like understanding tone signals. For example i like to find out if the person enters 3 (it's likely that this is done using it's tone sound). Do i need a special modem for this purpose or it can be done using only standard modems. 回答1: DTMF is the term you are looking for: http://en.wikipedia.org/wiki/Dual-tone_multi-frequency Whether you can process incoming DTMF tones with a particular modem depends on whether the modem

How to smoothly connect two signals in matlab [closed]

℡╲_俬逩灬. 提交于 2019-12-08 08:26:48
问题 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 5 years ago . I need to generate two signals which in the end I want to connect. The problem is that the end condition of the 1st signal can be quite different compared to the initial conditions in my 2nd signal. Subsequently it can result in a sudden and unrealistic jump in my final signal.

MATLAB - FM Modulation

旧巷老猫 提交于 2019-12-08 07:44:45
问题 I am trying to Frequency modulate a sine signal using Matlab. I have written the following code for the same: fc = 5000; %Carrier Frequency fs = 1000; %Signal Frequency t = 0:0.00001:0.002; x = sin(2*pi*fs*t); dev = 50; subplot(2,1,1); plot(t,x); y = fmmod(x,fc,fs,dev); subplot(2,1,2); plot(t,y); It is able to display the first plot command but not the second one. It throws an error: `fmmod' undefined near line 10 column 5 . What is wrong in the above code? 回答1: The following function will

Comparing FFT of Function to Analytical FT Solution in Matlab

给你一囗甜甜゛ 提交于 2019-12-08 06:36:11
问题 I am trying to compare the FFT of exp(-t^2) to the function's analytical fourier transform, exp(-(w^2)/4)/sqrt(2), over the frequency range -3 to 3. I have written the following matlab code and have iterated on it MANY times now with no success. fs = 100; %sampling frequency dt = 1/fs; t = 0:dt:10-dt; %time vector L = length(t); %number of sample points %N = 2^nextpow2(L); %necessary? y = exp(-(t.^2)); Y=dt*ifftshift(abs(fft(y))); freq = (-L/2:L/2-1)*fs/L; %freq vector F = (exp(-(freq.^2)/4))

Use of scipy.signal.lombscargle

瘦欲@ 提交于 2019-12-08 06:24:29
问题 For class, we are trying to prove a simple example of the Lomb-Scargle Periodogram using the embedded package in scipy. There is little documentation on how to use this function, and I have not been able to find any help online. When I run the code, I get a value of ~6.3 for the main peak of the periodogram, as opposed to the expected ~23.3. The data that we are pulling from is a simple .dat file with lists of numbers. Here is the code, any ideas on what's happening? import scipy as sp import

20hz-20000hz Butterworth filtering exploding

我的未来我决定 提交于 2019-12-08 05:58:13
问题 I want to filter out everything outside 20 Hz - 20000 Hz. I'm using a Butterworth filter: from scipy.io import wavfile from scipy import signal import numpy sr, x = wavfile.read('sweep.wav') nyq = 0.5 * sr b, a = signal.butter(5, [20.0 / nyq, 20000.0 / nyq], btype='band') x = signal.lfilter(b, a, x) x = numpy.float32(x) x /= numpy.max(numpy.abs(x)) wavfile.write('b.wav', sr, x) I've noticed that it works with a 44.1 khz file, but not with a 96 khz WAV file (demo file here) (it's not an audio

Accelerometer with FFT - strange output

老子叫甜甜 提交于 2019-12-08 05:38:37
问题 After reading a lot of research and works on subject I still have got problems applying FFT to my accelerometer data. Most of my code is taken from official MATLAB example: FFT for one dimension. After more reading I've found this question: FFT and accelerometer data: why am I getting this output? where there was suggestion to use windowing. So after some more reading I've added hamming window to my code. My data looks like that on plot: And this is the code that I am using for FFT: fs = 1/0