Questions tagged [python]
Python is a high-level interpreted general programming language. Python has popular numerical and scientific libraries/packages, most notably numpy and scipy. The scipy.signal package is a powerful signal processing software collection. This tag covers the use of numpy, scipy, and other Python packages often used for SP computations.
855
questions
1
vote
2answers
12 views
Scipy butter filter - remove DC offset w/ high sample rate
I am having a hard time figuring out how to employ a high pass filter to remove the DC offset of my data signal with the "scipy butter" function because my sample rate is quite high. The ...
0
votes
0answers
12 views
How do I create a composite triangle wave form in python?
I am trying create a composite wave pattern, such as a varying sawtooth wave in python.
So far I have:
...
0
votes
1answer
25 views
Python: Resample without equal
I would like to resample (downsample) a signal using python in order to get an even spacing and fill gaps.
About the signal:
It consists of a vector for y (amplitude) and x (timestamps)
Very slow; $...
0
votes
1answer
107 views
inverse discrete FFT in python, multiple times?
I was wondering what really happens when taking the inverse discrete FFT on some set of numbers, for 3 times? Because looking at it, it looks like we're getting an output that is identically with the ...
0
votes
1answer
213 views
Discrete-time, second-order section, direct-form II filter
I found dfilt.df2sos in Matlab and trying to figure it out how do I do that in Python? Is there any function that works similarly with the Matlab function?
I also ...
0
votes
0answers
11 views
Opencv python blob detection [closed]
I am trying to find two holes in the image using opencv simpleBlobDetector and apply it on a slow video with 3fps, I applied Canny Edge detection then SimpleBlobDetector but it can't find anything ...
0
votes
1answer
1k views
Adaptive Piecewise Constant Approximation (APCA) with wavelets/DWT
I am trying to approximate a vector or a time series, in order to have as little changes as possible. To do so, I pretend to apply the Adaptive piecewise constant approximation (APCA) algorithm. ...
0
votes
0answers
29 views
Possibilities in Audio Convolution Math
New Python user here! I am a musician working on a program to streamline a process of using convolution math on a folder of .wav samples. The idea is that each audio sample will be multiplied with ...
1
vote
2answers
54 views
Change the melody of human speech using FFT and polynomial interpolation [closed]
I'm trying to do the following:
Extract the melody of me asking a question (word "Hey?" recorded to
wav) so I get a melody pattern that I can apply to any other
recorded/synthesized speech (...
0
votes
1answer
21 views
Simulate butterworth filter with initial condition of state vector in R
I'm working in R with the packages signal and control (don't know wether these are even the best for my use case).
I have a high ...
1
vote
1answer
2k views
How to compute Laplace Transform in Python?
I am trying to do practicals for signal processing where I need to Laplace Transform a function. Used 'fft' of numpy before. Nothing of Laplace is found in the documentation. Do we have any other ...
2
votes
1answer
36 views
Calculating the peak power of a signal on python
As far as I've researched, the energy and power of a given (discrete) signal are given by
$$E = \sum_n \left|x_n \right|^2$$
$$P = \lim_{N\rightarrow\infty}\frac{1}{2N+1}\sum_n \left|x_n \right|^2$$
...
0
votes
1answer
30 views
How to find peak frequency in an audio frequency spectrum?
I have a audio file consisting of multiple frequencies, I need to find all the frequency peaks in the frequency spectrum after doing FFT.
But the issue is how can I be able to set the threshold line ...
1
vote
1answer
1k views
Filter ECG signal with Wavelet and Python
I have to filter the signal of an ECG with the wavelet method with Python. The data is in a txt file. I can create my dataframe with pandas, display that with seaborn, but can not find a way to apply ...
0
votes
1answer
243 views
how to extract a radio signal features with python?
I have a dataset of radio signals that i want to classify. So, I decided to extract features. After some googling, I have noticed that I have to calculate moments, cumulants, Kutosis and skewness to ...
0
votes
1answer
29 views
How to use values from the output of a block in GNURadio
I want to use the output values of the top_block as a way of directing my flowdiagram. So I want the flowdiagram to take one path if the output of my processing ...
0
votes
2answers
46 views
How can I obtain the transfer function from these two transfer functions in this case?
Using Scipy signal in Python I want to obtain a transfer function for an input which passes first from sys1 and then sys2. So ...
0
votes
2answers
42 views
change speakers voice to be like someone else voice [closed]
I have the following two audio,
audio1, _ = librosa.load(audios_path + wavfile1, sr=sample_rate)
audio2, _ = librosa.load(audios_path + wavfile2, sr=sample_rate)
i'...
0
votes
1answer
3k views
Bandpass filter for audio wav file
How do I apply a bandpass filter on an audio file which is in wav format?
And write back the filtered data in a new wav file for further analysis.
1
vote
1answer
87 views
SIS Particle Filter Python Implementation
Lets say I have some time series data which I generated like this:
...
1
vote
1answer
40 views
Dynamic filter in real time audio
Following my previous question: Removing cracking in real time audio, I'm trying to implement a dynamic filter in real time audio.
What I want to do is to create a filter where I can change the cut-...
0
votes
2answers
69 views
Removing cracking in real time audio filtering
I am getting back to DSP applications after a while and I've written a real time audio player in Python.
Basically I'm reading chunks of data from a .wav file (I am doing this to simulate a real time ...
0
votes
2answers
124 views
how can we align wto signals with a time lag in between?
I have two signals from two different sensors. I cropped the area i am interested in from both sensor signals. The problem is that the signals start at different time instants. I am searching for a ...
0
votes
1answer
64 views
How to detect Premature ventricular contractions (PVCs) in a ECG-signal
I want to know how to detect a Premature ventricular contraction (PVC) in a ECG-signal. A PVC is best seen from the V1-lead in an Electrocardiogram.
Figure 1: A) PVC coming from the left ventricle, ...
2
votes
2answers
82 views
Inaccurate phase returned by np.angle
I am generating 2 sine waves, first one has fundamental frequency = 50 Hz, amplitude=10, phase=0, the second one has fundamental frequency = 100 Hz, amplitude = 5 and phase = np.pi/6 (which is ...
6
votes
1answer
1k views
Issues with the smoothing operator in coherence estimation using the complex Morlet (Gabor) wavelet
The goal
I wish to compute the coherence estimate using the continuous wavelet transform (CWT) of a real-valued signal with the complex Morlet (a.k.a. Gabor) wavelet. I compute the cwt of the signal ...
0
votes
2answers
52 views
Converting Audacity Filter Curve EQ into transfer function and applying it to a signal via python
First of I am very new to Signal Processing and to python in general. I am trying to write a script where I would feed a voice recording into it, internally apply an eq and have the modified signal ...
0
votes
1answer
510 views
Confusion with data after cross correlation
Surely this question has been answered before in parts but I cannot find one solid answer. Ultimately I am trying to calculate the audio delay between two signals I am recording on USB microphones. ...
0
votes
1answer
29 views
Error introduced by smoothing filter at the end of a processing block
I'm running analysis on a multichannel audio signal and due to the size have decided to process it in blocks (my computer doesn't have enough memory to process it in one go). Some of the data produced ...
1
vote
2answers
57 views
My 3x3 Weighted Median Filter doesn't seem to be improving my image quality
In order to reduce noise in my training dataset,I attempted a WMF whose weights are shown in a 2-D array as follows(values finally get normalized by division by 15:
...
0
votes
1answer
35 views
Strange behavior from frequency to angular frequency in FFT
I have written a code to compute the Fast Fourier Transform of a simple complex exponential with frequency $f=50.0$, using scipy.fft. The code is written below:
...
0
votes
1answer
42 views
FFT of long signal by segments/chunks with discontinuities
I am processing an EEG brain signal, which has up to 64 data channels sampled at 500 Hz. One of the analyses consists of extracting the ratio of alpha/delta power, where alpha represents the waveforms ...
0
votes
1answer
124 views
reconstructing time-stretched signals for filtering purposes
I would like to know if it's possible to reconstruct the original time domain signal from it's time-stretched version? Is there any algorithm out there that can do this? Python, Matlab, etc?
I want ...
0
votes
1answer
24 views
Swift vDSP rFFT not same as Python np.fft.rfft()
I am trying to implement real FFT in iOS, for that i am using Accelerate Framework. Here is my Code for Swift.
...
4
votes
1answer
2k views
How can we know the geometry of a blob detected by OpenCV
I am performing blob analysis using connectedComponentsWithStats, which returns elementary statistics about the blobs (AABB and area). It is also possible to ...
0
votes
0answers
24 views
How detect if an object is missing from an image and set a Raspberry Pi GPIO output
I'm pretty new in OpenCv and Python. I want to detect an image. If a particular object is missing from the image set a GPIO output using on a Raspberry Pi.
What would be the right way? I don't want ...
0
votes
1answer
32 views
SMA, SVM and PSD python
I'm looking for python functions (package) to calculate SMA (signal magnitude area), SVM (signal vector magnitude) and PSD (Power Spectral Density). The goal is to extract features from an ...
2
votes
1answer
246 views
Kalman Filter EM Estimation of Covariances
The question might be very simple, but I get a strange result from Kalman Filter. Let us consider the simplest state-space model, the random walk plus noise:
$$
y_{t} = x_{t} + \varepsilon_{t}\\
x_{t} ...
0
votes
1answer
41 views
0
votes
1answer
400 views
Machine Learning - any suggestions to solve Python rounding errors?
I am working with Python to isolate voiced segments from music using the Jamendo corpus for singing detection. Training a model, I break my audio into frames, and have a label (0,1) for each frame.
...
0
votes
1answer
31 views
Cropping binary images based on pixel counts in python
I have a numpy binary masked image that looks like the following:
I want to automatically crop this image like the following:
Can I achieve this using some sort of image processing rather than ...
0
votes
1answer
864 views
Is there a way to obtain the transfer function from a bode plot on Python? (I know that it is possible on Matlab)
Quite simply, I have a bode plot obtained from a source signal.
Now I wish to obtain the transfer function.
I know it is possible with Matlab: http://www.mathworks.com/help/ident/examples/frequency-...
1
vote
1answer
345 views
Low-Pass Filtering of not evenly sampled signal
I have a signal sampled unevenly over 1 million ns.
the signal is sampled over 1GHZ clock and the samples are as the following:
0-100 ns - sample every 1 ns.
100-1000 ns - sample every 10 ns.
1000-...
0
votes
1answer
35 views
Eroding noisy borders of polygons in an image
I am new to image processing, and this is the task at hand.
I have a mask image of shape 500x500x1 that contains polygons.
These polygons (=vector data: common term in remote sensing and GIS) are ...
2
votes
1answer
1k views
Are there any signal processing libraries that implement TD-PSOLA?
For such a popular and old algorithm, I've had surprisingly little luck finding implementations. I've got it working in MATLAB, but am curious if any other languages have libraries containing it (...
0
votes
1answer
2k views
Comparing Welch and FFT power spectrum density
Based on previous answers from the forum, I implemented a function to compute the Power Spectrum of a 1D time series.
...
5
votes
1answer
6k views
Demodulating FSK audio in Python
I am trying to write a Python script that can demodulate an FSK modulated audio file and return the data encoded in the audio. The data being transmitted is GPS NMEA strings which are embedded as the ...
0
votes
0answers
12 views
Plot frequency tiling wavelets/curvelets
Is there a convinient way to plot the frequency tiling of for wavelets/curvelets? For example the input would be the number of scales $j$ and the output would be something like this:
Preferably in ...
1
vote
1answer
81 views
Calculate the magnitude and phase of a signal at a particular frequency in python
I have a signal for which I need to calculate the magnitude and phase at 200 Hz frequency only. I would like to use Fourier transform for it. I am very new to signal processing. And this is my first ...
0
votes
1answer
44 views
Frequency change detection in step-wise frequency chirp
I am driving a system with a step-wise frequency chirp from 50-400 hz with a frequency step of 0.01 hz. I am having difficulty identifying the points of frequency change as the data collected has an ...