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
34 views

Convert 16 bit PCM data into numpy array of amplitudes

I may not be using the right terminology here. I have a numpy array like: array([ 82, 73, 70, ..., 1, 230, 1], dtype=uint8) It's supposedly in 16 bit PCM format. I need to turn this into a ...
0
votes
0answers
7 views

Sort sounds by timbre similarity using Mel Frequency Ceptral Coefficients(MFCC)

I have about 30 sound clips that are each a preset from a synthesizer. I want to compare these sounds to find out which ones are similar, and then sort the sounds so that each sound is adjacent in a ...
0
votes
1answer
24 views

Filter design for an unusual EEG experiment

I'm designing a quite unusual (in terms of signal analysis) EEG experiment, which forces me to design my own filter. I have never done this before, so kindly please check my work and suggest ...
1
vote
2answers
28 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
58 views

How do I create a composite triangle wave form in python? [closed]

I am trying create a composite wave pattern, such as a varying sawtooth wave in python. So far I have: ...
0
votes
1answer
26 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
24 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 ...
0
votes
0answers
30 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 ...
0
votes
1answer
31 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
41 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
70 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
54 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 ...
1
vote
1answer
37 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: ...
2
votes
2answers
84 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 ...
1
vote
1answer
47 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
43 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 ...
0
votes
0answers
25 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
43 views

revert back to stft from abs and phase

I have the following code on python ...
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 ...
3
votes
3answers
565 views

Python audio analysis: which spectrogram should I use and why?

I am doing my final project at university: pitch estimation from song recording using convolutional neural network (CNN). I want to retrieve pitches existed in a song recording. For CNN input, I am ...
1
vote
1answer
118 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 ...
1
vote
1answer
32 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. ...
0
votes
4answers
47 views

Filtering Angular Measurements

I am trying to apply a filter to reduce noise in angular measurements. Since the data comes with noise, the filter needs to be able to handle measurements that are not smoothly progressing; for ...
0
votes
0answers
22 views

How can I compute the magnitude of edges of an image?

if I have an image with 11x11 pixels and In the center of the image is a square of 5x5 pixels. The gray level of the background is 0 and the gray level of the square is 50. How can I compute the ...
0
votes
1answer
30 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 ...
1
vote
0answers
62 views

MUSIC algorithm for DOA with floating point input signals

I am writing a Direction of Arrival (DOA) estimator using the MUSIC algorithm in python and am having trouble getting the correct spectrogram output. Specifically, my resulting graph comes out aliased ...
0
votes
1answer
49 views

What happens to the phase spectrum when I resample?

[An update is added at the end of the post after receiving first response] I have an algorithm which is very sensitive to phase shifts. It works with signal sampled at 40MHz (it's a neural network so ...
0
votes
0answers
24 views

Python equvialant of zero-phase IIR band-pass filter

A continuation on Matt L. answers, where Zero phase filtering with IIR filters is achieved with forward-backward filtering, as implemented in Matlab's filtfilt function. Main question: How can I ...
0
votes
0answers
19 views

Understanding CQT (Constant-Q Transformation) parameters for piano AMR (automatic music recognition) with Librosa Library

I am doing an automatic music recognition project with a deep learning model. For my data preprocessing, I am trying to calculate the Constant Q Transform for Polyphonic 88-key piano audio using ...
0
votes
0answers
26 views

Object for storing multiple trials of EEG MNE-python

I'm new to EEG and MNE. I'm looking for an MNE object to store data from many trials (trails * channels * times). I've noticed that I can use Epochs for that, and it works ok, but I wasn't sure if ...
0
votes
1answer
36 views

Transferring data over sound with QAM / QPSK

Been working on a FSK Modem in the last few weeks and have gotten it to work with 400bps, very reliable, atleast over a virtual audio cable, but it also works when playing a sound directly into a ...
0
votes
1answer
23 views

ValueError: operands could not be broadcast together with shapes (194,259,3) (600,800,3) [closed]

I got ValueError: operands could not be broadcast together with shapes (194,259,3) (600,800,3) with the below code: ...
0
votes
1answer
104 views

what does %matplotlib inline mean? [closed]

so i have this lab in coursera course, well i tried first at Linux terminal at the first command %matplotlib inline, it doesn't work : ( bash: fg :%matplotlib no such job ), even if I apply it like ...
0
votes
0answers
81 views

How do I generate a QAM signal using Python?

I have created a 16-QAM Constellation diagram ranging from {-3-3j ... +1+1j}. I then transform a given input string into symbols ...
1
vote
0answers
47 views

Plot Spectrogram and FFT plots from samples collected by Atheros AR9271

I'm entering the world of signal processing, and as one of my first projects I've decided to plot a spectrogram and FFT Plot. The samples comes from an Atheros AR9271. More details can be found here: ...
0
votes
2answers
49 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
0answers
19 views

Scipy visualize Linear filter using numerator coefficients

Python scipy signal package has a function freqs to get the frequency response of a linear filter from [b, a] numerator and denominator. So, I should be able to get ...
1
vote
1answer
32 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 ...
2
votes
1answer
64 views

Matlab FIR filter numerator coefficients to python

I created a equiripple FIR filter in Matlab using filterDesigner and exported it to an ASCII file. The file contains the numerator values as a list of 51 numbers ...
1
vote
1answer
43 views

Recreating matlab second order filter in python

I want to create some custom filters in Matlab filterDesigner tool and then apply those filters to a large set of audio files. I want to use python to do the ...
1
vote
1answer
51 views

Continuum Fitting with Python using specutils

it's my first time processing spectra from a black body radiation experiment, I'm using Python and having some troubles... I have this spectra with 2 peaks and uneven background noise which I want to ...
1
vote
1answer
146 views

Difference between librosa.stft and scipy.signal.stft

I read the source code of librosa.stft and sicpy.signal.stft, and notice that the calculation results of STFT(short-time fourier transform) in these two libraries are quite different: In scipy.signal....
0
votes
0answers
16 views

Which audio features to use for content based music recommendation

I am attempting to write a content-based music recommendation system using machine learning. Using a python library, I am able to extract the features from raw audio files. For each audio file, I have ...
0
votes
0answers
20 views

Identifying sounds patterns from wav file

I have an audio recording stored as a .wav file. My goal is to identify exact sounds patters from it using Python. The problem I'm facing is there's a clear "ting" sound in the audio file, ...
1
vote
1answer
18 views

Third octave band zero-phase forwards-backwards Butterworth filter adds amplitude to complex signals?

Overall aim: to take a short signal (likely to be noisy with some tonal components) and filter it into third-octave bands (TOBs), apply frequency-dependent spectral adjustments, then recombine the ...
0
votes
1answer
50 views

Relationship between amplitude and sampling rate

I'm loading a signal with librosa in python. With the original sample rate of 22050 Hz, i get the following waveplot: When i choose to resample my signal with the sample rate of 512 Hz, i get the ...
0
votes
0answers
32 views

Using MNE-Python for EEG trimming and Filtering

I am working on an EEG Signal analysis problem with python. I need to remove the recordings below 1st minute and above 6th minute of the signal, and pass it through a bandpass filter. I am not ...
0
votes
1answer
23 views

gnuradio - flowgraph with cpp

I build a flowgraph in gnuradio, generated python code, change a little and run it using python. My question is, does building the flowgraph in cpp will provide better results (time)? (in other words ...
0
votes
0answers
14 views

Registration of segemented medical images

I’m looking to register images based on probability maps (or possibly the binary images) resulting from segmentation of medical images of blood vessels with a circular FOV using python. Are there any ...
1
vote
1answer
30 views

Map time/scene differences between two similar videos

Goal: Given two videos that are episodes from series but in different format (one Bluray/one TV for example), map the time differences between the two (which scenes are not in one of the two) and be ...

1
2 3 4 5
18