Questions tagged [numpy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
39 views

Why are low frequency peaks not sharp in scipy fft?

I am using numpy/scipy to plot graphs of sine waves. frequencies at 15 Hz or higher give nice, sharp peaks, but at lower frequencies, the peaks are smeared and the actual peak frequency can't be seen ...
0
votes
1answer
44 views

Signal processing using numpy python

To process a .wav audio file with numpy (using fast Fourier transform algorithm). I want to process an audio signal at a particular interval with a sampling frequency 44100hz and sampling rate of 20ms ...
2
votes
0answers
61 views

How to get an interpolation weight from a mathematical definition

It was recently explained to me that a "Nearest neighbor" kernel for 1D interpolation can be implemented like this using NumPy ...
0
votes
0answers
25 views

delayed result in sinc upsampled signal

I have implemented an infinite kernel sinc interpolation. For some signals I notice an artifact, visible at the right end of the plot. I am wondering: is it a bug in my code or a phenomenon usual for ...
0
votes
0answers
121 views

Restoration problem with numpy fft function and self-made high-pass filter

Hi, I am using numpy.fft functions to do CV assignments in univ. But while implementing the high-pass and low-pass filter, I found something wrong during the process. The difference should converge ...
0
votes
0answers
47 views

Is there any python code for applying a-law/mu-law on 3D numpy array?

I have 3D numpy array of probabilities between [0,1], I need to emphasize on some area with lower probabilities. I was suggested to apply a-law and mu-law. I am wondering if there is python library/...
0
votes
1answer
194 views

Extrapolate a 2D array using Fourier Transform

I need to extrapolate a given 2D array to a larger domain, keeping the spatial frequency. This is the original field: (the data file in numpy npz format and a Jupyter notebook to plot it can be found ...
0
votes
1answer
63 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
0answers
154 views

retrieving complete 2d autocorrelation function from 2d power spectral density function (numpy.fft.ifft2)

My question is at the boundary between signal processing and python. I have a 2d power spectral density function (PSDF) constructed on Nx/2 + 1 and ...
0
votes
1answer
865 views

Autocorrelation: numpy versus FFT

I have a series a of values (0 and 1) coming from a Brownian process with drift for which I am studying the autocorrelation. I used two methods: 1) numpy autocorrelation: ...
1
vote
1answer
98 views

OFDM Simulation process

I'm trying to understand OFDM by making a simulation. Are these steps correct? generate M random complex QAM symbols. example: (1+j,1-j,-1-j,1-j....) Split my M samples into a N 2048 sized arrays ...
1
vote
1answer
3k views

Image processing based on wavelet transform in python [closed]

I take the dwt2 for an image and saved it's coefficients (LL,Lh, hl,hh) using pywt.dwt2 (image,'haar'),in my project I have to change them to uint8 but when I change their types and reconstruct the ...
1
vote
1answer
148 views

Fast Fourier Transform using numpy

I am a computer science student and didn't really have signal processing as a subject. Maybe I should be clear on the concepts of sampling rate and frequency of the signal but I am a little confused. ...
0
votes
2answers
114 views

Shifting signal smaller than discrete step

I have a image that I need to shift with less than a pixel. My plan was to do a Fourier transform and multiply the signal with $e^{-aiu-biv}$ where $a, b$ are the shifts in x and y direction. This ...
1
vote
0answers
663 views

Acceleration time series to velocity conversion using DFTs

I have 1000 Hz time series data for acceleration (512 data points), which I want to convert to velocity. I am trying to use the omega arithmetic method to achieve this. Following are the steps I am ...
1
vote
1answer
802 views

Discrete Fourier transform of an exponential decay

I have a vector with an exponential decay, using Numpy: t=np.arange(128) k=0.1 decay=np.exp(-k*t) I would like to compute the discrete Fourier transform (DFT) of ...
1
vote
1answer
1k views

Amplitude of frequency bin in FFT doesn't match time-domain amplitude

I have a sinusoidal current that I am sampling at about 357k SPS. The current signal is about 3A pk-pk @ 750hz (top figure). I am wondering why when I take the fft using numpy/scipy's fft function, ...
1
vote
1answer
1k views

Numpy fft2 frequency shift

I don't understand how to make frequency shift in fft2 or higher dimensions. Could anyone explain it, please? import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import ...
0
votes
1answer
199 views

How to interpret the signal in frequency domain

I'm having difficulties understanding some basics regarding FFT. I was hoping you could answer a few questions I have. These questions will probably seem silly to you, sorry for that. I'm a complete ...
5
votes
1answer
214 views

Morphing between two FFTs

I'm a musician and I'm making a script that takes a wave file and snaps each of its frequencies from the fourier transforms to the nearest musical harmonic. Thanks to help from another question I ...
0
votes
1answer
55 views

Unexpected peaks in power density following downsampling and filtering

I first applied a 100 Hz lowpass filter to my data, which was recorded at 30000 Hz: ...
0
votes
2answers
2k views

Why is the size of the output of the FFT of a signal is same as the size of the input signal?

I am kind of new to the DSP domain. I was trying to get the frequencies associated with a signal by performing FFT over it. I used numpy.fft.fft for this. ...
0
votes
0answers
3k views

AM Modulator Demodulator in Python

I am trying to make a AM modem using Python Numpy and Matplotlib. I am successful in generating the AM Signal but I cannot demodulate it using a lowpass filter function that I made. The demodulation ...
3
votes
2answers
870 views

Understanding a simple case of fft2 in python

I have 2D arrays representing surfaces. I have created them by scanning some theoretically flat objects and I ended up with what can be called "imperfections", or else, deviation from the perfectly ...
0
votes
1answer
120 views

Using fft to calculate vsdft

We are currently implementing the velocity synchronous discrete Fourier transform (vsdft) for order tracking rotating machinery in Python. The formula is similar to dft. Simplified, it is given by $...
1
vote
1answer
1k views

Result of inverse FFT is sometimes shifted in real space

I am using the Numpy fft2, ifft2, and related functions and I am sometimes running into a strange situation where the output ...
4
votes
1answer
1k views

How to generate random samples of Gaussian distribution directly in the frequency domain?

One can easily draw (pseudo-)random samples from a normal (Gaussian) distribution by using, say, NumPy: ...
0
votes
2answers
6k 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. ...
1
vote
1answer
918 views

Hamming Window, python 2.7 [closed]

Hi I have a FFT which is quite noisy. How to apply to my code Hamming window to make it less noisy. Look at my code: ...
2
votes
3answers
4k views

Looking for Fastest 2D Convolution in Python on a CPU

Convolutions are essential components of many algorithms in neural networks, image processing, computer vision ... but these are also a bottleneck in terms of computations... In the ...