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.

Filter by
Sorted by
Tagged with
3
votes
0answers
8k views

numpy.correlate and autocorrelation; audio signal

I want to calculate delay between an input and an output audio signal of my audio processing system. The input and output signals are available as signed 16 bit integers. To try out, I tried the ...
7
votes
1answer
1k views

Removing a sinusoidal artifact from a set of movie frames

I am doing some post-hoc analysis of a dataset consisting of a series of movie frames that are contaminated by a strongly periodic artifact. I would like to remove this artifact from my frames. For ...
1
vote
1answer
209 views

period detection for a series of photons

I have a dataset which records the arrival time for a series of photons. I am using lomb-scargle method of scipy.signal to try to find some kind of period. Since the arrival time is random,how to ...
2
votes
2answers
2k views

Zero-padding in STFT

I a recent topic, it has been told that zero-padding in the STFT can improve it, and avoid some circular convolution related things. Here is my Python code for STFT : ...
0
votes
1answer
218 views

DWT with more precise scale

With a signal x of length $2^{16}$, the DWT (computed for example with pyWavelet's wavedec) has only 16 or 17 rows (the wavelet ...
12
votes
3answers
4k views

STFT and DWT (Wavelets)

STFT can be successfully used on sound data (with a .wav soundfile for example) in order to do some frequency-domain modifications (example : noise removal). With ...
0
votes
2answers
4k views

scipy.signal.wiener for audio processing

Does some have an example of what a Wiener filter (that can be used directly with scipy.signal.wiener) can be useful for, in sound processing (it seems that such ...
2
votes
1answer
712 views

Synthesize Digital Filter with Arbitrary Frequency-Response

fdesign.arbmagnphase is a MATLAB built-in function that will create a filter that best fits the frequency-response that it is given. I'd like to implement a similar function in Python. What ...
6
votes
4answers
7k views

Differences between Python and MATLAB filtfilt function

I'm trying to port some MATLAB code to Python and am running into some strange behaviour. I am implementing a 5th order Butterworth bandpass filter. The sampling rate is 30 Hz. Running MATLAB R2012b, ...
2
votes
0answers
223 views

Inpainting: which algorithm should I choose? [closed]

I have a 3D data set sampled on a regular grid shown in the Figure below. This data can be interpreted as an image where the point altitude is equivalent to the pixel intensity value. In the middle ...
6
votes
1answer
1k views

Haar series approximation of a function?

I'm trying to code the Haar wavelet approximation of a function. I'm a complete newbie. Edit Below is a pseudo-code of my algorithm for $f: [0,10] \to \mathbb R$, $f(x)=x$. I picked it here and ...
2
votes
1answer
923 views

Wavelet time extraction

I am trying to understand one simple thing in wavelets and I searched a lot, but did not get any idea. I need to perform Multilevel 1-D wavelet decomposition on my signal. I have arrays ...
3
votes
5answers
12k views

generating spectrograms in python with less noise

I'm trying to do something similar to Shazam (paper here) in Python. Basically the idea is to use FFT with sliding window to transform both WAV files and recorded audio to the same spectral ...
0
votes
1answer
595 views

Compute PSD from a CSV file

I'm sorry if my question might be simple, but I don't have a strong background on signal processing. I have a csv file of a 8 MHz bandwidth, sampled with a resolution bandwidth of 100 KHz. What I want ...
3
votes
1answer
220 views

Constraint on a filter

First of all thanks for your patience: it is the first time for me posting a question in this forum. I am not a DSP expert, but I should get by if you give me in depth explanation. This is an example ...
1
vote
2answers
11k views

Algorithm to zero pad data before FFT

I've seen some other questions on here about zero padding (like this one) but I'm still a little confused about my situation. I'm attempting to zero pad my input time series data, so I get an ...
5
votes
2answers
415 views

how can I calculate pitch deviation in a large collection of audio files?

I am making a software model of an existing digital synthesiser and I have made audio recordings of single notes with particular parameter settings. I made a program in C++ which sends a MIDI sysex ...
1
vote
1answer
2k views

with SciPy, how to generate waveform with common pulse shapes?

With Python/Scipy, if I have a simply BPSK signal sequence [1, -1, -1, 1, ...], how can I generate a real-valued baseband waveforms with oversampling rate ...
1
vote
1answer
6k views

Spectrogram of wav file

I am calculating spectrogram of a audio file of 36 second using the following code snippet: ...
1
vote
1answer
508 views

Has this Principal Component Analysis (PCA) been done correctly?

I have a set of 3D data points, indicated by the blue color in the picture below. I then project them onto the x-y plane, i.e. setting z values of all the points to 0, shown by the yellow color below....
2
votes
2answers
553 views

Implementing a phase-neutral band-pass filter using SciPy

Does the following code properly implement a phase-neutral band-pass filter using SciPy? ...
4
votes
1answer
13k views

What do I do with the result of an FFT?

So I am working on a project using digital signal processing, which I am not familiar with at all, and a lot of this is all new to me. I am using SciPy\NumPy to play around with code to understand the ...
2
votes
0answers
2k views

Ricean Multipath channel model implementation

I'm trying to implement a multipath ricean channel model. I had found several resources but I'm kind of lost with too much information. What I have from now is the following step: ...
3
votes
2answers
461 views

Fixed point channel model for OFDM system

I'm testing an OFDM system implemented in fixed point. The data format is Q11. My system work's fine but I need to test it under some channel for evaluation of the design before field testing. The ...
2
votes
1answer
4k views

Apply AWGN noise to QPSK-OFDM symbol

I'm working on an OFDM-QPSK based system and I'm having some trouble to match the BER of my system with the theoretical curve. My OFDM implementation fills all the subcarriers and have t_symbol s ...
3
votes
3answers
6k views

How to find the group delay of IIR filters in Python/SciPy

I sent a square wave signal (red) through a IIR filter (butterworth in this case), to make it more "realistic". Then there's a slight group delay in my output signal (blue). Is there a way to find out ...
16
votes
1answer
20k views

What is the phase and magnitude response of white noise?

I would like to create white noise in the frequency domain, and then transform it to the time domain using python. To understand the problem, I simply generated white noise in the time domain, and ...
1
vote
1answer
2k views

Amplitude calculation

I've got an array of different values representing the y-values in a plot: ...
5
votes
2answers
3k views

Simulating analog filter using convolution or converting with fft

My task is simple; I want to simulate analog low-pass filtering of an input signal, using Python. Note that the input signal is an array of values, not an analytical function. My first question is if ...
2
votes
1answer
6k views

Deconvolution in Python

I'm trying to use and understand SciPy's deconvolve for a project I'm working on. I'm having some trouble understanding how to use it. What I would like to do is to take two PMFs from discrete ...
1
vote
1answer
2k views

How can i measure shape elongation feature in matlab or python opencv?

How can i measure shape elongation faeture in matlab or python opencv? There is a function library or i have to implement to my own? In case there is no function, i found this definition: "The less-...
5
votes
1answer
7k views

Working backwards from PSD to possible signal

I have been trying to reconstruct a random signal from its PSD and am running into trouble. I know that many different signals in the time or spatial domains can result in the same PSD-- I am ...
2
votes
0answers
205 views

There are other shape properties scale-rotation invariant except HuMoment?

There are other shape properties scale-rotation invariant except HuMoment? There are example that show me how can i implement them? I find this example in c++ https://stackoverflow.com/questions/...
2
votes
1answer
1k views

All-pass filter implementation in numpy

I'm playing with Python & numpy to filter audio. It is relatively straightforward to design and us low-high-bandpass/stop FIR and IIR filters, stuff can be done in a couple of lines. I'm ...
7
votes
1answer
2k views

Failed to implement Goertzel algorithm in Python

After some questioning on stackoverflow, I tried to implement a Goertzel algorithm in Python. But it doesn't work : https://gist.github.com/4128537 ...
1
vote
0answers
527 views

Use fourier transform to calculate image pixelation coef in python

I want to calculate a coef of image pixelation to remove bad pictures from a bunch of files. Some pictures results from bad compression and we can see a lot of pixelation on them like img a here: ...
3
votes
2answers
3k views

Half Subcarrier spacing in LTE Uplink

First post here, trying to make it as good as possible. Do not know how to make the Python code look nice - any tips? :) Anywho - to the main problem: I am currently working on simulating the uplink ...
19
votes
3answers
10k views

What's wrong with this code for tomographic reconstruction by the Fourier method?

I've been playing around with tomographic reconstruction algorithms recently. I already have nice working implementations of FBP, ART, a SIRT/SART-like iterative scheme and even using straight linear ...
34
votes
7answers
19k views

Finding squares in Image

I need to find the squares in an image using OpenCV (no problem in matlab or any other, generally what i expect are some ideas). Consider the test image below : I need to find those coloured squares ...
8
votes
3answers
5k views

Is it correct to subtract a low-pass filtered signal from the original signal and use the result as a “high-pass”?

I am having a hard time trying to find documentation to implement band-pass or high-pass filter with python/scipy/numpy. I can easily create and apply a low-pass filter, though, so I ask: Would it ...
27
votes
3answers
30k views

Picking the correct filter for accelerometer data

I am fairly new to DSP, and have done some research on possible filters for smoothing accelerometer data in python. An example of the type of data Ill be experiencing can be seen in the following ...
5
votes
3answers
13k views

Beginner Attempting FFT Signal Filtering With Numpy

I've tried looking around for information on this, but I'm really out of my league here. I'm a guy who likes to fool around with Python, and I wanted to make a program that would filter an audio file. ...
9
votes
1answer
341 views

Recognizing data clustered into shapes

I am working on a project in Python to detect and classify some bird song, and I have found myself in a position where I need to convert a wave file into frequency vs. time data. This hasn't been too ...
16
votes
5answers
48k views

How to write lowpass filter for sampled signal in Python?

I have some signal that sampled each 1 ns (1e-9 sec) and have, let say, 1e4 points. I need to filter high frequencies from this signal. Let say I need to filter frequencies higher than 10 MHz. I want ...
3
votes
1answer
407 views

How to remove color cast from HSV information

I have hue, saturation and value of a color (HSV color-space). The color has to be set on a device that displays them incorrectly. If I specify white it displays light magenta. However, if you specify ...
14
votes
4answers
14k views

Scipy - Audio Processing

I am looking for good tools for Audio signal processing. e.g Speech & music analysis, automatic language identification, etc. Does the Scipy library provide functions for audio processing? Does ...
5
votes
2answers
4k views

Complex impulse response functions?

I think I must have misunderstood something regarding the relation between impulse and frequency responses. I have calculated the Impulse Response Function, IRF, from the Frequency Response Function,...
16
votes
4answers
9k views

Counting the number of groups of 1s in a boolean map of numpy.array

I am right now dealing with some image processing in Python via PIL (Python Image Library). My main aim is counting the number of colored cells in an immunohistochemistry image. I know that there are ...
3
votes
2answers
625 views

What is the best method for merging time lapsed photos? Accessable from python(PIL)

I have numerous photos from a still image camera that I would like to merge into one photo to allow for easy spotting of motion or new objects. There is a bit of noise across the photos but not very ...
4
votes
2answers
10k views

How to remove the boundary effects arising due to zero padding in scipy/numpy fft?

I have made a python code to smoothen a given signal using the Weierstrass transform, which is basically the convolution of a normalised gaussian with a signal. The code is as follows: ...