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
2answers
9k views

Avoiding “RuntimeWarning: invalid value encountered in log10” when converting FFT data to dBFS

I've attached some code below that I'm having some issues with. Basically, I need to write a function to get the dBFS value of a signal at a specified Hz value, at a given channel in a .wav file. ...
0
votes
0answers
9 views

Image processing with .HPG files

I have files with extension .hpg and I want to perform image processing on those file as they are hp plotter file. I tried googling but no luck there. hence hope someone can help me tackle this with ...
2
votes
1answer
227 views

Extract approximation and detail coefficients

I am a student and would like to know how to extract the approximation and detail coefficients (A5, D5, D4, D3, D2 and D1) after an applied DWT decomposition dB5 (Daubechies 5, level = 5)?
0
votes
1answer
771 views

Python bandpass filter - singular matrix error

I've been trying to design a bandpass filter using scipy but I keep getting a LinAlg Singular Matrix error. I read that a singular matrix is one that is not invertable, but I'm not sure how that error ...
0
votes
1answer
31 views

Side lobe reduction [closed]

How can side-lobes be reduced in an Level-1 SAR image in Spatial Domain?The input here in this problem is an complex SAR image?which parameters(like amplitude) of SAR image should be considered mainly ...
1
vote
0answers
39 views

Implementation of Cepstrum in Python

Actually I want to denoise a signal. I know how can I implement FFT in python to denoise it. This is the implementation which I use(From this Kaggle notebook): But I don't know : How can I use ...
0
votes
1answer
53 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 ...
0
votes
0answers
34 views

Reconstructing a signal from multiple filtered copies using overlapping tapered windows

I have an audio signal that I need to process and analyse in blocks. I've now decided to process it using overlapping non-symetric Hanning windows of length M = 9600 and a hopsize of R= M/2. I zero ...
2
votes
3answers
338 views

Unscented Kalman Filter - Multiple Consecutive Measurement Updates

In trying to implement an Unscented Kalman Filter (UKF), I have come across the issue of what to do when my measurement signals come in at a different rate than my control inputs, which I use in the ...
0
votes
1answer
25 views

Equal probability quantizer in Python

I am trying to apply Haralick textures to a SAR image (float32). As far as I know, the image first needs to be quantized to a reasonable bit depth prior to calculate the co-ocurrence matrix. In the ...
0
votes
1answer
17 views

brightest amplitude of an image pixel

How can amplitude of an image pixel be calculated?Do we need to perform any FFT on the image? and how to find the brightest value among the amplitudes in python or matlab?
1
vote
1answer
27 views

Filtering artefacts and filtering short signals

I have a signal from EEG sensors and I try to denoise it from AC frequencies. For that reason, I estimated PSD of my signal and found that 50 Hz and 100 Hz are likely to represent noise. I constructed ...
0
votes
0answers
22 views

How do I change the sampling rate without changing the speed and pitch in Python?

I am building a voice recognition algorithm, and the use case specifies that it should be able to identify the targeted speaker from various audio sources, which means that it must be able to process ...
0
votes
0answers
26 views

How can i get Celsius/kelvin temperature from a thermal image in python language?

How can I convert RGB values of the thermal image into Celsius or kelvin temperature in python? Here is the thermal image taken by a FLIR device: Here I am reading image using OpenCV and getting the ...
0
votes
2answers
37 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
21 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 ...
0
votes
1answer
37 views

Receiver function, frecuency domain deconvolution not giving logic results

I'm working on some code for receiver function method in seismology. For anyone one not into the topic, it's just a deconvolution of two time series (seismograms). This can be done in the time domain ...
8
votes
4answers
3k views

How to perform a Rubberband-Correction on spectroscopic data?

I basicaly understood how the Rubberband/Baseline-correction works. The given spectrum is divided into (N) ranges. The lowest points in every range are determined. The initial baseline is built out ...
1
vote
1answer
948 views

Third octave bandpass filter with python

I am very new to signal processing and coding which is why my questions might be really basic. I have a signal of the acoustic pressure p'(t) and I would like to use a third octave bandpass filter in ...
0
votes
1answer
130 views

How do I detect the sharp edges in the following image?

I am looking to count the sharp pointy triangular things in the image. However I was unable to do so. One approach I did try was take a convex hull of the contour and then find convex defects but it ...
0
votes
1answer
46 views

Mulitplication in Frequency Domain as a Similarity Measure of Audio Clips

I have an audio clip and I copy a 256-point part satarting at 10th second. Then I create a 256-point frame on the original clip. At every itreation, I calculate the DFT of the frame, multiply it with ...
0
votes
1answer
26 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 ...
0
votes
1answer
141 views

Choppy output when trying play through a callback buffer

I am trying to make a keyboard in python where every note's frequency is a ratio of the previous note but my output is strangely choppy for some reason. Here's an example of what I mean. I'm using ...
0
votes
1answer
34 views

Possible to get transfer function coefficients from window?

I am hoping to use scipy.signals.filtfilt() to smooth some signals in Python, and wanted to build the filter based on a window like a hanning window or whatever. E....
1
vote
1answer
484 views

Frequency range for STFT in Librosa

I am currently looking at the STFT for Librosa. I was wondering how to understand the output of the STFT function, specifically what kind of frequencies the different values represent. Say I have a ...
4
votes
1answer
133 views

A-weighted Digital Filter for 1/3rd Octave Band Analysis

I want to do a 1/3rd Octave band analysis on a noise signal. But the sound pressure levels should be in dB(A), i.e., and it should be A-weighted. For this, I am using the A-weight function from this ...
1
vote
1answer
36 views

FFT shows systematic deviations from analytical result

I am calculating the numerical Fourier transform of an exponential decay exp(-|t|) and compare it to the analytically calculated result, a Lorentzian. I find that the numerically calculated spectrum ...
0
votes
0answers
20 views

Comparing mechanical signals with different length

I couldn't find any solution for this that would work for me I'm working in python. I have two similar signals that I can plot Force x Angle. (problem simplified) One plot (angle x force) has length ...
0
votes
0answers
22 views

Get displacement from acceleration with DFT

I looked at the already existing topics: here, here or matlab code, finally here I tried to create my python code but it is not working : ...
0
votes
1answer
31 views

Zero peaks in fft data even after subtracting mean

I have a time series sensor data. It is for a period of 24 hours sampled every minute (so in total 1440 data points per day). I did a fft on this to see what are the dominant frequencies. But what I ...
0
votes
1answer
58 views

What's the difference between “Magnitude Spectrum” and “FFT”?

I am particularly talking about the matplotlib's axes.magnitude_spectrum() function that plots the magnitude spectrum. Is this a representation of the discrete Fourier transform?
0
votes
0answers
41 views

Synchronization of tx and rx in sdr

I am implementing a FMCW radar using bladerf sdr: When reading the output from the vector sinks, the outputs are not synchronised.How should I synchronise them? is it possible to do so using gnuradio ...
1
vote
5answers
195 views

Detecting a three-tone signal in real-time

I'm new to digital signal processing, and I've been looking into FFT, filtering, Matlab etc. What I'd like is to build a program which will detect when a certain BEEP is transmitted through a trunked ...
0
votes
1answer
52 views

Faded line in spectrogram for a chirp

I've generated this spectrogram using wavelet convolution. The chirp is generated like so: ...
0
votes
0answers
30 views
3
votes
1answer
59 views

Understanding Parseval's Theorem with Discrete Wavelet Transform

I have difficulty to understand the results I get with implementing Parseval's Theorem in Python to DWT. I have the good results getting the Energy with Fourier transform and the time series in python:...
0
votes
1answer
25 views

Plotting a Time Frequency contour/colormesh plot of a Discrete Wavelet Transform

I have a pressure vs time data of a noise on which I wish to perform discrete wavelet transform. I have divided my frequency range into 1/3rd Octave Bands and have calculated sound pressure level at ...
1
vote
0answers
17 views

Is my implementation of Generlized Pencil-of-Function correct?

I have a time-series data that should be of the form $$ f(t) = \sum_nA_n(e^{\alpha_n t}+e^{-\alpha_n(T-t)});\;\alpha_n=\eta_n+i\omega_n;\;i=\sqrt{-1} $$ and I want to find parameters $A_n$, $\eta_n$, ...
0
votes
0answers
52 views

Filter a negative SNR signal whose frequency spectrum lies inside the noise frequency spectrum

I am a newbie in Signal Processing and need your suggestion in the following problem. My signal amplitude is 10 times weaker than the noise. Furthermore, the frequency spectrum of the noise and the ...
0
votes
0answers
32 views

How to correctly pass filter states from one processing block to the next

I'm processing a 4 channel audio signal and due to memory requirements need to process the signal in an arbritrary number of blocks. To ensure consistent filtering between blocks I've been told I need ...
0
votes
0answers
102 views

Using FFT for implementing a filter bank

I am trying to use Fast Fourier Transform (FFT) for decomposing an audio signal into 8 sub-bands according to this link but the problem is the frequency response of the result contains only the first ...
0
votes
1answer
76 views

Decimating Non-Uniform large time-series data

I'm working with accelerometer data that is sampled at a non-uniform rate. There are major gaps in the data. Below is a scatter plot of the data I can also give a sense of the frquencies at which ...
1
vote
2answers
55 views

Decimation Question about using a low pass filter before downsampling

I have a bunch of audio files that have a sample rate of 380kHz, however I would like to reduce this sampling rate to 44.1kHz. From doing some research online, it seems like I will have to use a low ...
1
vote
1answer
35 views

linear-expansion filter for image (2D array)

I am working in python analyzing 2D arrays and I am looking for a filter or some other routine that would provide a linear expansion of an region boundaries in a 2D array with binary regions (i.e. a ...
1
vote
2answers
800 views

What is the difference in between the different STFT implementations? (Overlap-shift with zero-padding, overlap-add, overlap-save, etc)

I'm trying to understand STFT overlapping, why segments are concatenated and what are the consequences of this. My implementation (from other questions and repositories found) of the STFT in Python ...
0
votes
2answers
745 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
1answer
34 views

Implementing a finite impulse respone (FIR) filter for computing the derivative of a discrete signal

I am trying to reimplement an algorithm on my own. In the description of the implementation, it's written that they compute the derivate of a series of value using a [-1/2, +1/2] finite impulse ...
1
vote
1answer
35 views

How to apply band-pass filter and get the filtered back from frequency to time domain in python?

I know this is basic for signal processing, but, I am not sure what is wrong about my approach. I have a signal that behaves as damped sine signal with a sampling frequency of 5076Hz and 15,000 number ...
0
votes
1answer
52 views

How to allign audio signals after DTW?

Hello I am not a domain expert in signal processing but I need to align two audio signals. I have seen the following page https://librosa.github.io/librosa_gallery/auto_examples/plot_music_sync I ...
0
votes
1answer
50 views

What function to apply a Metamorphopsia (grid warp) translation?

How would I go about finding or creating a function to warp images dependent on grid lines surrounding an origin (I don't wish for a grid on my actual images): It should work in practically the same ...

1
2 3 4 5
16