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
0
votes
0answers
26 views

Strange signals in wifi channel

I am currently working with a USRP B200 mini-i to receive 802.11 signals from various usb wifi devices. When sending packets with the USB device over a channel, lets say 2.412GHz, i can't really see ...
0
votes
1answer
55 views

How to manually implement convolution with FFTs?

I'm trying to manually implement a convolution using FFTs and it isn't working as expected. I know I'm probably missing some subtlety with padding, shifting, or conjugation, (all of which I've tried ...
1
vote
0answers
27 views

How to create different Time frequency images from a data

I'm new to Python. I have a time series in a CSV file that has about 5000 rows and 3 columns. I have split the data into training and testing in ratio 70:30 respectively. However, I have a problem ...
0
votes
0answers
6 views

Image extraction post processing to increase similarity

I’m trying to train an OCR model, but I need to get my extracted images to look more like the training images. However I’m not sure of how to go about it and what techniques I can use. For instance ...
0
votes
0answers
31 views

Kalman-Filter Estimate the position

I am quite new in this field and trying to learn Kalman-Filter but i am quite lost how to start my task. This is the file description Problem. I guess the state vector x must be the poistion of ...
0
votes
1answer
33 views

Comparing spectra from hyperspectral images

I extracted the mean spectra of regions of interests of different tissues from hyperspectral images. How to compare those spectra by the difference of their reflectance and their spectral behavior (...
0
votes
1answer
15 views

script to check zero crossings to check if microphones phases are aligned

I have 'n' microphones placed in square fashion and I want to make sure that all the channels must be aligned in time exactly the same if the signal is equidistant from all the 'n' microphones i.e. in ...
0
votes
1answer
30 views

generate a repeated square pulse train in python

Generate a pulse train with -2dBFS pulses of 20 sample duration every 8 seconds. I have referred here to generate a pulse train but not able to repeat it. How can I repeat this audio signal every 8 ...
0
votes
1answer
23 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
0answers
20 views

modelling radar system for image generation

I am trying to find or derive some model for radar using python and blender which should hopefully create a simulation of what a radar image of the blender environment would look like. I have been ...
1
vote
0answers
139 views

Plotting a scalogram of a signal's Continuous Wavelet Transform (CWT) in python

So I've been learning about wavelets for a few weeks because I'd like to use them in a research project I'm working on and I've been trying to grasp the general ideas behind them.I've been struggling ...
0
votes
1answer
85 views

python3: speech recognition - calculating features of a WAV file

I am supposed to do this as a school project, but I am kind of lost when it comes to signals and would appreciate your help. Also, English is not my first language, and I will be translating the ...
0
votes
0answers
19 views

Can I get some help plotting an IIR filter frequency response in Python?

The problem I'm trying to solve is described here. In my script, I used Euler's identity to calculate z^-n, such that z^-n = cos(omegan) - jsin(omegan). I find the magnitude of these values from a ...
0
votes
1answer
54 views

How to plot the periodic digital spectrum?

In a previous answer, Dan Boschen wrote (emphasis mine): First let me explain the "unfolded" digital spectrum: If you allow the frequency axis of the sampled signal to extend to $\pm \infty$, ...
0
votes
0answers
23 views

Cepstrum calculation with 5-smoothing zero padding

I am trying to compute cepstrum of a signal x An implementation of this in python is: ...
0
votes
2answers
57 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
0answers
36 views

Python resampling and filtering question

Intro Hi I'm looking for someone with some experience to walk me through some questions I have regarding resampling (downsampling) in Python. Here is my problem: I have accelerometer data that comes ...
0
votes
0answers
59 views

Trying to convert Raw image(Bayer format) to jpg/png image in Python

I am using the Sony Low-light image dataset from the paper Learning-to-see-in-the-Dark. I am trying to convert Raw image (bayer pattern in arw format) into a jpg/png. I used an online tool that gives ...
0
votes
1answer
35 views

How to measure algorithmically side lobes in real data

I want to measure algorithmically the following parameters in a given FFT data (real numbers). peak side lobe levels side lobe levels 
side lobes nulls The following image illustrates parameters I ...
2
votes
2answers
77 views

Why is my signal attenuated after applying a HighPass-filter?

I am new to DSP, but I've been attempting apply a butterworth high-pass filter on a 1D array (Values peeking at 300~) to eliminate any noise, yet when applying a high pass filter, I'm ending up with ...
0
votes
2answers
122 views

downsample signal to a specific number of samples in Python

The Python Scipy library provides several functions to downsample signals, but they all have limitations: The resample function is based on Fourier method, which means it assumes periodic signals. ...
0
votes
1answer
60 views

How can I correctly plot an impulse_response() of a discrete transfer function?

I posted this question on stack overflow and I think it was the wrong place so I moved it here. Hello, I'm new to python, I just want to use the control library and I'm slowly learning, I did my ...
2
votes
1answer
57 views

Large spike at beginning of signal after applying Bandpass filter

Foreword: I am a PhD student and fairly unexperienced with many signal processing and engineering concepts, please be gentle. I am attempting to filter out a frequency range of 1Hz to 2Hz from a 2....
1
vote
1answer
25 views

Applying a 2D band pass filter (Butterworth ?) to an array with NaNs

I am trying to filter out the low frequencies of an array looking like this : For now, I am taking transects of this array and applying a 1D - butterworth band pass filter : ...
1
vote
1answer
182 views

Running the BM3D Denoising Algorithm in Python

I am looking for a strong baseline in image denoising and therefore wanted to have the BM3D algorithm in my benchmark. These 2 python implementations: https://github.com/ericmjonas/pybm3d https://...
0
votes
1answer
115 views

Demodulation of FSK signal

What kind of FSK signal is this and what demodulation technique can I use to demodulate it. Why is the phase of the 1's changing like that and how does that effect how it needs to be demodulated. I ...
1
vote
1answer
51 views

SciPy Lfilter issue

For one of my DSP projects, I decided to use python to perform signal processing. While I am new to python, I understand that it is a very powerful and versatile language. For my processing, I opted ...
3
votes
5answers
280 views

What Are The Semantics Of Wav-File Sample Values?

The title is the question. To make this concrete, assume I have a standard 16-bit single channel wav file, with (although it doesn't matter) a 16000 Hz sampling rate. Each sample magnitude will be a ...
0
votes
1answer
33 views

which features fundamental frequency is correlated?

I'm unable to compute $f_0$ (fundamental frequency) in librosa feature extraction. By ready much in github issues check the second comment. I see that $f_0$ is ...
0
votes
1answer
43 views

numpy.linalg.lstsq underdetermined case

I would like to understand what I am doing wrong here. I am trying to perform polynomial regression by minimizing the least squares, ||Au-y||^2, where y is the given data and A is the matrix where the ...
0
votes
0answers
46 views

Stuck with plotting wavelet transform in Python

I want to plot the frequency composition of a sampled signal data versus time by using surf or any 3D plot. Normally time resolution of FFT is zero so I want to use wavelet transform where I want to ...
0
votes
0answers
12 views

Normalize a Mel-Spec over which axis?

I have to find out: how to normalize a Mel-spectrogram.(for mashine-learning purpose) However, I don't know which axis has to be transformed. The spectrogram S is of shape (m x n) where n are the ...
1
vote
1answer
84 views

Understanding Fourier Transforms in abstract math terms

I am having a hard time implementing a method that computes Fourier transform coefficients for the complex form using the trapezoid rule. I have floated questions in the math and stackoverflow ...
2
votes
1answer
82 views

get poles and zeros of frequency response

I am working on a python based LTSPICE project. I would like to get poles and zeros of AC simulation data. Is there a way to get them under use of the magnitude and phase out of the frequency ...
0
votes
1answer
35 views

estimation of ARMA(1,1) with MA parameter greater than 1

I am working with the following simple ARMA(1,1) model: $$ z_{t+1} = \phi z_{t} + \theta\varepsilon_{t} + \varepsilon_{t+1} $$ In my case $\theta$ depends on some other parameters, and, therefore, I ...
1
vote
0answers
14 views

Looking for a way to fill holes in objects, and break bridges between them

I am trying to extract building footprints from satellite images. Using a series of morphological operations i.e erosion and opening by reconstruction, I'm able to obtain the footprints, albeit with a ...
1
vote
0answers
135 views

Problem using pitch shifting with TD-PSOLA and formant preservation

I tried out this implementation of TD-PSOLA (https://github.com/sannawag/TD-PSOLA) and even though I know how the algorithm works, I can't understand why I get NO audible differences in the output ...
2
votes
2answers
53 views

How to detect real time sound onsets?

I'm a Software Engineer Undergraduate. I'm trying to detect drum strokes(beats) in real-time in python. I used amplitude threshold-based onset detect (beat detect) algorithm but it takes other noises ...
3
votes
0answers
46 views

How to compare imaginary coherence values?

High, I am currently writing my Master's thesis on susceptibility for hypnosis. I am comparing EGG signals of lowly and highly susceptible individuals. The imaginary coherence is given by: $$ \...
0
votes
0answers
49 views

How accurate is Python's FFT?

I am getting started with Python's FFT. I tested it on a signal that is a sum of three signals, two of which have an eigenfrequency of the grid, the third one does not (but due to large no. of data ...
0
votes
1answer
49 views

Real Fast Fourier Transformation (FFT) in 2D changes with changing the axes order

I am using Python to calculate the real FFT for a 2D array. I found that the real FFT function does not return an array with the same size as the input array, rather, it returns an array with the same ...
2
votes
1answer
73 views

KalmanFilter 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
0answers
20 views

Calculating a transform with a circle and lines

I am trying to determine the transformation (rotation + translation + scale) between two images in order to shift them. The images are taken with two different modalities that produce very different ...
0
votes
0answers
38 views

Scaling x axis for FFTs in Python

I edited the post to be more specific, see below. I have a dataset, on which I need to perform and IFFT, cut the valueable part of it (by multiplying with a gaussian curve), then FFT back. First it's ...
0
votes
0answers
101 views

Does bicubic downsampling in PyTorch internally involve anti-aliasing?

Does bicubic downsampling in PyTorch torch.nn.functional.interpolate internally involve anti-aliasing? If not, how can we avoid aliasing when direct using bicubic ...
0
votes
0answers
10 views

Want to create a function that calculates the ISO and Shutter speed based on the brightness of previous image

I want to calculate the shutter speed and ISO of Picamera using the brightness information of the previous image I captured. I have already calculated the brightness of the previous image but I am ...
0
votes
1answer
78 views

Understanding the FFT phase spectrum with a simple example

I'm trying to compute the DFT using scipy's functions. I don't understand why the phase spectrum of a simple sine wave with 2 Hz frequency doesn't show $\pm\pi/2$ at the $\pm 2Hz$ frequencies. Instead,...
0
votes
0answers
16 views

Compute SNR for a noisy signal in Python [duplicate]

I have a discrete signal represented by an array in Python: $x \in R^N$. Now I add Gaussian noise to x: $x = x + np.random.normal(l=0, s=1, size=x.shape)$. How can I compute the signal-to-noise ratio ...
0
votes
2answers
132 views

I wish to create a GNU Radio program in C++ that doesn't need GRC or Python, is there a reference or template for this?

I want to create a functionally equivalent C++ file to the Python top_block.py file that is generated by GRC when executing a (blank example) flow chart. I know that C++ can be used to define blocks ...
3
votes
1answer
69 views

Square wave FFT results show frequency that seems too low?

I have created an open source plotting package for a low cost oscilloscope - see link here: GitHub Plotting Software But during my testing I have one result that may be wrong: a noisy 7 kHz square ...