signal-processing

From Amplitude or FFT to dB

老子叫甜甜 提交于 2019-12-23 00:26:41
问题 I've a Python code which performs FFT on a wav file and plot the amplitude vs time / amplitude vs freq graphs. I want to calculate dB from these graphs (they are long arrays). I do not want to calculate exact dBA, I just want to see a linear relationship after my calculations. I've dB meter, I will compare it. Here is my code: #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import scipy.io.wavfile as wavfile import scipy import scipy.fftpack import numpy as

Power spectral density of FFT

落花浮王杯 提交于 2019-12-22 18:30:54
问题 I have a piece of code that gets the FFT of a part of the signal and I'm now trying to get the PSD, Fs = 44100; cj = sqrt(-1); %T=.6; dt = 1/Fs; left=test(:,1); right=test(:,2); time = 45; interval =.636; w_range = time*Fs: (time+interval)*Fs-1; I = left(w_range); Q = right(w_range); n = interval * Fs; f = -Fs/2:Fs/n:Fs/2-Fs/n; s = I+cj.*Q; % Smooth the signal ss = smooth(s,201); sf = (fftshift(fft(ss(1:n)))); %FFT of signal figure(1) plot(f,((20*log10((abs(sf))./max(abs(sf)))))) From my

Power spectral density of FFT

末鹿安然 提交于 2019-12-22 18:30:04
问题 I have a piece of code that gets the FFT of a part of the signal and I'm now trying to get the PSD, Fs = 44100; cj = sqrt(-1); %T=.6; dt = 1/Fs; left=test(:,1); right=test(:,2); time = 45; interval =.636; w_range = time*Fs: (time+interval)*Fs-1; I = left(w_range); Q = right(w_range); n = interval * Fs; f = -Fs/2:Fs/n:Fs/2-Fs/n; s = I+cj.*Q; % Smooth the signal ss = smooth(s,201); sf = (fftshift(fft(ss(1:n)))); %FFT of signal figure(1) plot(f,((20*log10((abs(sf))./max(abs(sf)))))) From my

plotting a parabola within part of a repeating signal using numpy

半城伤御伤魂 提交于 2019-12-22 11:28:05
问题 I have a repeating signal that varies a little bit with each cycle of a process that repeats roughly every second, though the duration and the contents of each cycle vary from each other a little bit within some parameters. There are a thousand x,y coordinates for every second of my signal data. A small, but important, segment of the data within each cycle is corrupted, and I want to replace each corrupted segment with an upward facing parabola. For each data segment that needs to be replaced

How to begin building a VSTi Plugin?

流过昼夜 提交于 2019-12-22 09:34:21
问题 Im wondering the exact method through which I would go to build a VSTi Plugin is. I don't expect to code the next Massive in a few shorts week, as I have no knowledge of DSP and very basic programming skills. Im sure this is probably above my current level but I figure I'll grow as a programmer if I give myself a high goal that Im deeply interested in. All that being said, Im at a loss as to where to begin. I know that I would need to download the Steinberg VST SDK, but many of the other

spike in my inverse fourier transform

你离开我真会死。 提交于 2019-12-22 08:08:27
问题 I am trying to compare two data sets in MATLAB. To do this I need to filter the data sets by Fourier transforming the data, filtering it and then inverse Fourier transforming it. When I inverse Fourier transform the data however I get a spike at either end of the red data set (picture shows the first spike), it should be close to zero at the start, like the blue line. I am comparing many data sets and this only happens occasionally. I have three questions about this phenomenon. First, what

C/C++ Library or example code for DSP Using the TI-MSP430

爷,独闯天下 提交于 2019-12-22 08:01:15
问题 I am working on a little dsp project doing audio processing (e.g., Nyquist rate sampling, over- and undersampling, reconstruction) that is real-time embedded using my board. The current board/chip I am using is the msp430 series from Texas Instruments. MSP430F5438 Experimenter Board <-- ( Among recommendation ) http://focus.ti.com/docs/toolsw/folders/print/msp-exp430f5438.html First of all would you recommend buying a copy of matlab or octave as my main coding tool. I am using the CCS ( Code

Unwrap angle to have continuous phase

给你一囗甜甜゛ 提交于 2019-12-22 07:39:12
问题 Let's say I have an array of phases similar to this: import numpy as np import matplotlib.pyplot as plt phase = np.linspace(0., 100., 1000) % np.pi plt.plot(phase) plt.show() (with many discontinuities like this) How to get an array of more "continuous" phases from it? Of course, I already tried with np.unwrap: plt.plot(np.unwrap(phase)) or plt.plot(np.unwrap(phase),discont=0.1) but it stays exactly similar: What I expected was an unwrapping like this: 回答1: If you want to keep your original

For what kind of applications can i use dsp core of beagleboard? Can i use the DSP acceleration for background subtraction algorithm?

≡放荡痞女 提交于 2019-12-22 07:08:46
问题 For what kind of applications can i use dsp core of beagleboard? Can i use the DSP acceleration for background subtraction algorithm in OpenCV? 回答1: You can use the DSP for all kinds of computations. It is a general purpose CPU optimized for DSP applications. So yes, even floating point stuff will work albeit the performance will not be great. The DSP really shines if you do integer computations over large arrays of data. Here the DSP can easily compute so fast that the time to transfer data

scipy.signal.spectrogram compared to matplotlib.pyplot.specgram

二次信任 提交于 2019-12-22 05:11:13
问题 The following code generates a spectrogram using either scipy.signal.spectrogram or matplotlib.pyplot.specgram . The color contrast of the specgram function is, however, rather low. Is there a way to increase it? import numpy as np from scipy import signal import matplotlib.pyplot as plt # Generate data fs = 10e3 N = 5e4 amp = 4 * np.sqrt(2) noise_power = 0.01 * fs / 2 time = np.arange(N) / float(fs) mod = 800*np.cos(2*np.pi*0.2*time) carrier = amp * np.sin(2*np.pi*time + mod) noise = np