# Questions tagged [numpy]

The tag has no usage guidance.

46 questions
Filter by
Sorted by
Tagged with
43 views

### Visualise/compare numpy arrays from Matlab/Octave to matplotlib

I'm new to python and matplotlib, and I'd like to visualise / compare 3 mfcc files stored as numpy arrays in txt format. I have the Octave code below, and I'd like to know how it can be done using ...
229 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 ...
7 views

### Numpy 2D FFT produces corona that is not uniform around center

Tldr: Numpy FFT creates non uniform output when output is wanted to be uniform. I want the output to be a uniform corona. I am trying to eventually run a Gerchberg-Saxton phase retrieval algorithm. I ...
67 views

### Output shape of numpy's rfft function

For numpy's rfft function, the length of the output is about half of N, the length of the input sequence. What is the reason behind this? What are the frequency bins?
90 views

### Wrong values calculating FFT with EEG Bands using Numpy

First of all I have to say I am very new to these matters. I am trying to apply FFT algorithm to some values obtained by EEG bands. I found the following code but I am unable to make it work correctly....
67 views

### FFT on continuous fifo data - Is y axis magnitude sum of all samples?

I'm running an fft once a second on a buffer of data 60 seconds long. The data is sampled at 558Hz and is placed into the fifo buffer once per second. FFT is numpy.rfft. The data is scaled to psia ...
31 views

### What is the difference between sampling over $-4\pi$ to $4\pi$ and 0 to $8\pi$

I see no difference in magnitude, but the phase plots vary significantly while using NumPy and MatPlotLib to plot. Looking at the phase plots, I feel like I'm missing something important. Also, I'm a ...
330 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 ...
311 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 ...
66 views

### Why does numpy FFT only work for samples of 10,20,30 sec?

I'm using numpy FFT functions to find the amplitude, frequency and phase of low frequency signals. focusing between 0-10 hz.Part of my project is to vary the time over which the sample is taken and ...
157 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 ...
9k 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 ...
47 views

### Establish instantaneous amplitude of signal

I'm using the YIN algorithm to establish the pitch of my humming / whistling voice. This is a time domain algorithm and gives me the instantaneous frequency as a function of time ($f(t)$). I now wish ...
207 views

425 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 ...
39 views

### How to produce color image using edge detected images?

Hi I am trying to produce an image which is a combination of multiple images such as in focus stacking. Now I have 6 photos and I want to produce a final image such that the final image uses blocks of ...
93 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 ...
671 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 ...
3k 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: ...
30 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 ...
2k 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 ...
318 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/...
7k 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 ...
630 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 ...
143 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 ...
7k 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 ...
519 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. ...
1k 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 ...
2k 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 ...
3k 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, ...
3k 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 ...
364 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 ...
94 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: ...
2k 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: ...
4k 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. ...