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
1answer
23 views

Upsampling in Python

I'm trying to perform upsampling in Python. Given the signal 's' and factor of upsampling N, I wrote the following code: ...
0
votes
2answers
45 views

Fast Fourier Transform showing the same results but with different files?

so I'm pretty sure that I'm plotting the wrong frequency domain against my FFT values because I keep getting basically the same graph shape every single time. I think that I just don't comprehend the ...
0
votes
1answer
47 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?
2
votes
2answers
2k views

FFT showing peaks at 0Hz?

so I've been attempting to do a FFT on some data and I'm seeing a peak at 0Hz, which I can't really comprehend why since I'm quite new to signal processing. I read in my file using pandas, saved them ...
0
votes
0answers
16 views

How do you apply DCT steganography on an RGB image?

I am working on a DCT-based steganography program in Python and I found a working model in Github. The program, however, can only encode on one of the RGB channels. Resulting in a discolored image. ...
0
votes
1answer
34 views

How to get the area(Pixels count) inside ring-like shape?

I have the following image, and I do like to count the pixels inside the ring to get the area. I did some morphological operations as a kind of post-processing to make the image as much as possible ...
1
vote
2answers
313 views

Understanding sine wave generation in Python with linspace

I was trying to sample a 12.8 MHz sine wave (78.125 ns) signal at every 160us (micro seconds). Since 160us is multiple of base period 78.125ns(x2048) i expected to get a sample of fixed amplitude but ...
0
votes
1answer
22 views

Typical parameters and stability of Chebyshev filters

I design Chebyshev first and second type filters using scipy.signal.iirfilter. What are typical values of maximum ripple in the passband and minimum attenuation in the stopband? I struggle to find ...
1
vote
1answer
30 views

IFFT and sample count issue in OFDM

I wrote a python program to generate OFDM packets (i.e. the IQ samples) with a custom payload to, for example, be transmitted via an SDR. After mapping the chunk of bits corresponding to one ofdm ...
0
votes
0answers
18 views

How to optimize padding and truncating of signal

I 6000 signals that vary between 3000 and 30000 in length In the figure under you can see that most of the signals are of length 5000. So I decided to pad and truncate all signals to 10000 and feed ...
0
votes
0answers
32 views

Finding the PID values for a vehicle control system

I'm trying to design a PID system for the longitudinal control of an autonomous vehicle. I figured out about most of it but I'm trying to figure out the Kp, Ki and Kd values. This is an illustration ...
0
votes
0answers
30 views

Why is there a difference in the spectrum of an audio file between Sonic Visualizer and my Python script?

I am working on a script which is creating a spectrum analysis from an audio file using SciPy and NumPy. Before I started, I analyzed the file using Sonic Visualizer, which got me the following result:...
1
vote
0answers
20 views

Difference between these two Continuous Wavelet Transforms?

I am porting Synchrosqueezing to Python, and came across an implementation difference on CWT between mine and PyWavelets' - details below. The idea is to merge this implementation to PyWavelets if ...
0
votes
0answers
11 views

Remove unwanted portion from a signal in python

I have a signal which measures current and save it the form of 1D array. The signal follows a typical patters and I will be doing some research work on that pattern. But before the pattern appears, ...
0
votes
0answers
45 views

Maximally Stable Extremal Regions (MSER) Implementation in Document Image Character Patch Identification

My task is to identify character patches within the document image. Consider the image below: Based from the paper titled "CG-DIQA: No-reference Document Image Quality Assessment Based on ...
0
votes
0answers
21 views

Evaluate the quality of the satellite image resampling method

I'm evaluating different methods of resampling on Sentinel 2 images for switching from 20m to 10m bands. Comparing bilinear, cubic and lanzcos methods I would like to judge the best result. Several ...
0
votes
1answer
33 views

Difference between frame rate and sampling rate?

Below are the two different methods of generating time to create an audio sine wave. While framerate is being used as steps in one method, the inverse of sampling rate is being used as steps in the ...
0
votes
1answer
32 views

Creating highpass from lowpass in Python

I want to create high pass filter from low pass filter in Python. My code: ...
0
votes
1answer
40 views

audio reprocessing for machine learning

I have a bunch of phone interviews where there is large sound volume difference between two voices in some of the interview audios, because they were recorded only on one side of the phone. May I ask ...
1
vote
1answer
74 views

Reduce Jitter in Live Kalman Filter

I have a stream of data over time that I have fed into a Kalman filter. This data represents the vertical displacement in time of a vehicle's rearwheel as it travels over a bump in the road. The ...
0
votes
1answer
54 views

Implementation of Filters in Python

I've implemented 2 filters in Python I would like to know if they look OK or not.. I've implemented an lowpass FIR Hann Filter and an lowpass IIR Chebyshev type 1 filter. My plots look like the ...
2
votes
2answers
92 views

Contradictory results from power spectral densities and autocorrelation in shot noise

I have a white noise generator circuit which involves a Zener diode meant to undergo breakdown across a resistor $R1$, and am trying to compare power spectral densities and autocorrelation of the ...
1
vote
1answer
28 views

Identify if a Specific Edge Pixel Belongs to Horizontal, Vertical or Diagonal Edge Line

I have a code below that identifies the edge of the text image. Input image is: Output display is: I want to select random points near the edge border of the text. I was thinking to identify if the ...
0
votes
1answer
46 views

Can't implement correctly Python IIR and FIR Filters

I'm trying to implement 2 lowpass filters and see the difference between them from plots( one FIR filter that needs to be designed with the Hann window method and another IIR filter using Chebyshev ...
0
votes
2answers
113 views

Lowpass Hann filter in Python

I'm trying to design a FIR lowpass filter using Hann windowing in Python but I don't know where to start from... I have fc1,fc2, ft, rp and rs as parameters. This is my Python code: ...
2
votes
1answer
90 views

2D DFT in image processing in python

I try to compute 2D DFT in a greyscale image with this formula: I write the code bellow with python ...
0
votes
0answers
11 views

Question regarding the implementation of the guided random walks algorithm

I'm working on the implementation of the paper: Segmentation by retrieval with guided random walks: Application to left ventricle segmentation in MRI. I tried to modify the weights functions mentioned ...
0
votes
0answers
62 views

Running the BM3D Denoising Algorithm in Python with unknown noise type, what PSD value should be used?

I am looking to apply the BM3D denoising filter to an image. There is a past post where a user applies the bm3d pypi package to achieve this here. This user applies the bm3d filter as follows: <...
1
vote
2answers
109 views

How to develop a spectrogram (2D array) from audio signal?

I have developed a spectrogram in Python using Scipy.Signal.Spectrogram. But I need a complete understanding of data. Here I am not asking about plotting and color ...
0
votes
2answers
53 views

How to get coordinates(x(time),y(frequency)) of spectral peaks from spectrogram?

I have created this spectrogram from a wav file. Please have a look: As it can be observed clearly that my somewhat spectral peaks are visible. I want to get the x = time, y= frequency of these ...
0
votes
1answer
123 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 ...
1
vote
1answer
39 views

Need a similarity metric that describes these two curve as highly similar

I have a large number of time series data and I need to be able to compare the similarity of the curves to a reference curve. The reference curve in question is shown in red in the figure, and I'd ...
-1
votes
4answers
90 views

Hanning Window Bandwidth

I am using scipy's "scipy.signal.hanning" to determine a hanning window. This method returns an array with the window and specific number of points based on your input. More info: https://docs.scipy....
0
votes
0answers
24 views

EEG signal windowing and framing in python

I would like to do EEG signal(using 1 channel) Windowing and Framing. Actually I am doing my thesis and following a research paper.In this paper they explained "Windowing consists of dividing ...
0
votes
0answers
38 views

How to separate EEG frequency band in python?

Sorry for stupid question! I am very new in EEG signal processing and python environment.I have started my a project work related to EEG signal analysis using MNE. I would like to separate EEG Bands ...
0
votes
0answers
32 views

Simulating packet loss in audio

I have loaded a wav file into a Python Numpy array. I would like to "perturb the signal" such that the audio sounds akin to audio streamed over a poor internet connection. How can I mutate the ...
0
votes
2answers
243 views

Am I supposed to normalize FFT in Python?

I'm sorry if this question is posed often, I can't seem to understand the answers already out there. I'm working with several forms of the Fourier transform, including the FFT, PSD, and spectrograms. ...
0
votes
1answer
20 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, ...
0
votes
0answers
29 views

How to approach Feature Extraction and Feature Selection part in machone learning in python?

I am a bit new to machine learning and I have the following questions: Question 1: When dealing with feature extraction with signals from sensors, what is the typical approach to extract features ...
0
votes
0answers
53 views

Feature extraction for exponentially damped signals

I am looking into exponentially damped signals where it is a stationary signal (after implementing the Adfuller statistical test) and I would like to look into how can I extract meaningful features ...
0
votes
0answers
12 views

Visualization of wavelets coefficients using python

I need to prepare a plot similar to figure below using coefficients of details of a wavelet transform.I am trying for more than 2 weeks to find how I can do it. This plot represents coefficients of ...
0
votes
1answer
32 views

Programmatically (e.g. in Python) adding clipping to an audio file? [closed]

I am trying to replicate the audio artifact exemplified here to a set of 1000 audio files. In particular, I would like to be able to 'clip' the louder parts of each sound clip so they become distorted ...
0
votes
0answers
39 views

Time domain to angular domain approach

I have a rotating shaft where I need to move from the time domain to the angular domain to look for vibration faults. I have the data from a tachometer. From another post I found these steps: The ...
0
votes
1answer
45 views

Upsampling question- Aliasing/imaging problem

I'm trying to study vibrations in a non-stationary shaft by upsampling the original signal. The original sample rate is at 25.6kHz, and it is being upsampled to 36kHz. In the FFT of the upsampled ...
0
votes
1answer
27 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 ...
0
votes
0answers
44 views

Wavelet transform : how to recover wavelet basis matrix?

In this article, It is said that an image $x$ can be sparsely expressed, if the basis is well chosen. It is said something like "$x$ can be expressed as follows : $x = \psi\theta$ [...] Many ...
0
votes
1answer
70 views

Analyze PCM data

I am getting some 16 bit PCM data (raw bits) from a serial port . I need to collect this stream of bits using some python application running in PC and store it somewhere(Assume it in an array). I ...
0
votes
0answers
35 views

Removal of EEG noise using cascading adaptive filtering technique

I am required to filter out noise from EEG data using preferably Python or MATLAB. My dataset contains values for 64-electrode EEG along with their time-corresponding HEOG (horizontal eye movement), ...
0
votes
1answer
39 views

Measure how Straight/Smooth the Borders are Rendered in an Image

I have two images: I want to measure how straight/smooth the text borders are rendered. First image is rendered perfectly straight, so it deserves a quality measure ...
1
vote
1answer
48 views

How do I generate sound using Python3?

I am totally a newbie in signal processing. I want to generate and play sound for frequencies (1/3 octave band center frequency) 125 Hz, 250 Hz and 500 Hz respectively, each for 30 seconds and with ...

1
2
3 4 5
16