Questions tagged [signal-processing]

AKA digital signal processing (DSP). A signal is an information-carrying wave, but in the digital sense, a 'signal' refers to either received or transmitted streams/blocks of data, commonly representing real-world quantities such as audio levels, luminosity, pressure etc over time or distance. 'Processing' is the act of altering, analyzing or characterizing the data to retrieve/modify information inherent in the signal in question.

Filter by
Sorted by
Tagged with
1
vote
1answer
48 views

Script to check zero crossings to check if microphones phases are aligned

I have 'n' microphones placed in square fashion and I want to make sure that all the channels must be aligned in time exactly the same if the signal is equidistant from all the 'n' microphones i.e. in ...
4
votes
2answers
154 views

Peak and valley finding algorithm

I'm trying to improve my algorithm to make it faster. Also might help to have a few sets of eyes for any bugs or gaps in logic I didn't catch. One thing to note: because of the nature of the algorithm,...
5
votes
1answer
121 views

Implementing 3Blue1Brown's description of Fourier transform in Python+numpy

I have implemented the 3Blue1Brown's description of Fourier transform in Python+numpy for irregular and unsorted data, as described here. ...
5
votes
1answer
60 views

Calculating silence in a WAV file

I made this script to calculate the amount of silence in seconds in an audio file. Is this a good method to do this, and if yes, can it be improved? It takes about 4 seconds for 20 audio files of 100-...
6
votes
1answer
914 views

Peak valley detection in python

Below is a peak/valley detection algorithm I've designed. The basic premises for this function is that we split our data into chunks, do linear regressions on these chunks, detrend the data based on ...
4
votes
1answer
100 views

Expanding the region of interest of an image

I am solving a problem of increasing the ROI of a retinal image using the below algorithm- First, the set of pixels of the exterior border of the ROI is determined, i.e., pixels that are outside ...
6
votes
2answers
90 views

Basic digital RC approximation filter in python (Micropython)

I have written a simple RC Filter approximation in python that I have a feeling could be more concise. Are there any obvious improvements? ...
15
votes
3answers
1k views

Radix2 Fast Fourier Transform implemented in C++

Note: If you don't know much about Fourier transform algorithms, a simple review of whether I am doing anything inefficient with C++ in general would be appreciated. I've been working on implementing ...
8
votes
1answer
249 views

Bilinear image interpolation

I have written a bilinear interpolant, which is working moderately well except that is painfuly slow. How can rewrite the code to make it faster? Using opencv directly isn't a valid answer. ...
3
votes
1answer
135 views

Hurst Exponent calculator

I am aiming to compute the Hurst Exponent of a 1-D signal time series in Python. For now, I have one existing function hurst(sig) which returns the Hurst exponent ...
2
votes
0answers
59 views

Sampling and Reconstructing a signal in Julia

I am a newcomer to the Julia world, so I started trying to implement a very simple program: Sample a signal Reconstruct it (various ways, just rectangular for now) Plot it Everything is fine and '...
1
vote
0answers
66 views

Convolutions with shared memory in CUDA

I am writing a noise blur convolution kernel in CUDA ...
5
votes
1answer
236 views

Blurring a given image using moving average in Python 3

I've tried solving the following HackerRank question: Write a function blur_image() that takes as a parameter an image in the form of a nested list ...
9
votes
1answer
138 views

Discrete Lanczos Derivatives

I have a PR implementing denoising discrete Lanczos derivatives, following this paper. The following code works well, but the design is a train wreck, and I was hoping to get some advice to improve it....
3
votes
3answers
109 views

A collection of vector functionals

I would like some feedback for a collection of what I call "vector functionals", by which I mean maps \$\ell\colon \mathbb{K}^{n} \to \mathbb{K}\$, where the field \$\mathbb{K} = \mathbb{R}\$ or \$\...
2
votes
4answers
298 views

Modulating an oscillator by gain, pitch, and offset

I've an Audio Host application that sends block of samples to a DLL I'm building. It sends 44100 samples per seconds (i.e. Sample Rate 44100hz), per block, processing 16 distinct Voices. It ...
1
vote
2answers
53 views

Audio processing with normalized [0.0, 1.0] domain

I've a code that process buffers of samples/audio data. Here's the code: ...
2
votes
0answers
958 views

Gray-level co-occurrence matrix feature computation

I have many images and want to compute the GLCM properties for every image. Below my code that runs many hours to complete the task: ...
2
votes
2answers
495 views

Processing voice samples

I'm within an audio application that sends variable-length buffers to my DLL, which will process at higher speed (48000 samples per sec, but can also be higher). Here's the code I've written: ...
9
votes
4answers
478 views

Performing a “mean blur”

I perform a mean blur on a number[][]-array (called grid in the code). I iterate the array, and calculate average values from ...
5
votes
2answers
428 views

DSP-Quantizer class in C++

I have written a class to quantize values to arbitrary bit depths within a specified amplitude. It is meant to process one value at a time, and has two ways of quantizing values. I wrote the class so ...
2
votes
1answer
93 views

Applying correction to a time series in Matlab

I face a computation efficiency problem. I have a time series of a non-monotonically drifting variable, that is measurements of objects going through a machine (where the measurement is made) in a ...
6
votes
2answers
6k views

Median Filter Implementation In Python

I implemented median filter in Python in order to remove the salt & pepper noise from the images. It is working fine and all but I would love to hear your advice or opinions. ...
4
votes
2answers
127 views

Poor performance for signal processing

I have a program doing a LOT of iteration (thousands to millions to hundreds of millions). It's starting to take quite a lot of time (few minutes, to a few days), and despite all my effort to optimize ...
3
votes
1answer
3k views

Moving median filter (medfilt) in C

I have implemented a Moving Median Filter and I would like a review. I am using a linked list to keep track of the oldest value in the kernel and an array of nodes ...
5
votes
1answer
536 views

Matlab IIR filter implementation

I need to implement the Matlab filter(b,a,x) function in Java. Before I do this, I would like to rewrite the function in Matlab before translating into Java. So far,...
4
votes
0answers
2k views

Applying hysteresis to a signal

Using python 3.6. I have written this code (below) to apply hysteresis to a signal (a numpy array). My aim was to create a function that didn't require any loop to remember the previous state of the ...
1
vote
0answers
127 views

Performing FFTW double[2] on images of type cv::Mat

I've two different types of variables: cv::Mat and array of type double[2] so I do quite lot of copying between the two types. I ...
3
votes
2answers
305 views

Spectrum Analysis with Discrete Fourier Transform

Here is a simple implementation of the Discrete Fourier Transform: myFourierTransform.m ...
6
votes
2answers
1k views

Implementing convolution using SymPy

I started using SymPy recently, and I implemented convolution using it. ...
13
votes
1answer
1k views

OpenCL implementations of IQZZ and IDCT for MJPEG

I am using this code for MJPEG decoding and I am trying to make two functions (IQZZ and IDCT) run faster on the GPU (NVIDIA Tesla k20c). I am using the OpenCL framework to accomplish this task. I ...
5
votes
1answer
116 views

Non-recursive filter to smoothen saw tooth wave

I'm currently writing some of my first assembly code for a new project, I am applying a small non-recursive filter algorithm to some saw tooth wave data held in memory, in order to blunt the edges. ...
4
votes
1answer
891 views

Radix-2 FFT in C

I'm a beginner in C programming. I am current trying to work on a project requiring 1024-point FFT implementation using radix-2, Decimation-in-frequency. I attach the FFT function C code. How can I ...
6
votes
2answers
189 views

Denoise an image under extreme time pressure

I'm working on a real-time, embedded system image processing application for my group engineering capstone in undergrad. I'm receiving data at 60FPS, and have to isolate and detect the location of a ...
3
votes
1answer
215 views

Cython code for adaptive binning

Here is my Cython code used for adaptive binning. The calcAdaptiveBinnedRateMap function is called from another Python script. The script is compiled using Cython ...
5
votes
2answers
2k views

Plotting an input curve and its FFT using gnuplot in C++

I'm currently working on a project1 which will result in millions of FFTs being solved time and time again. I have a finished prototype in Python (using numpy, scipy, and the pyfftw3 package), but ...
3
votes
1answer
291 views

FFT Frequency Shifter Extravaganza

I've been writing a frequency shifter in C++ for an Audio Unit plugin. The best way for me to do this while keeping a large amount of other algorithms working in the same plugin was by writing a ...
8
votes
6answers
2k views

DFT (Discrete Fourier Transform) Algorithm in Swift

I am looking to replicate in Swift what the FFT function does in Matlab. Essentially, it takes an arbitrary length signal (not necessarily a multiple of \$2^n\$) and gives real and complex DFT ...
2
votes
0answers
135 views

Reduce sample rate of GPS data based on distance between points

The algorithm needs to reduce an RDD[GPSRecord] based on the distance between several points, e.g. "give me only GPS records when the distance between them exceeds ...
4
votes
2answers
153 views

Temporal kernel filtering on video frames coming in a loop

I have a video which I read in a loop frame by frame. For every frame, I want to do temporal kernel filtering, the coefficients of which come from the input variable model (a dictionary). The temporal ...
2
votes
3answers
119 views

Generating a sinusoid sound signal in Java

Is there any legroom left for optimization (without switching to C)? ...
1
vote
1answer
265 views

Factory to create Finite Impulse Response filters in C++

I've recently begun a project in digital signal processing and am using C++ as the programming language. In this project, I have implemented several finite impulse response (FIR) filters. Many of ...
4
votes
0answers
99 views

Neuroscientific testing

I have written the code below for the following experiment: Subjects get simultaneous stimulation of left and right thumb and have to tell which one was stimulated "stronger" (with higher intensity, ...
1
vote
2answers
2k views

Perlin Noise Generator

I'm porting a 2-D Terrain Generator from Python to C++ as Python is too slow due to the number of features that have been added. I'm new to C++ and would like to know of any criticisms that you can ...
2
votes
1answer
369 views

Find signal's maximum peak in window

I have a 9-dimensional signal (as a csv from this Gist) that looks like this: A signal peaks every 30 steps. I want to get the maximum values of the peaks in that ...
4
votes
1answer
91 views

Wavelet decomposition of images

I am working on wavelet decomposition and found a formula for it and wrote it by myself for computation. The formula is: $$I_{LH}(i,j) = \sum_{p=1}^{N_L} \sum_{q=1}^{N_H}\ L(p)\ H(q)\ I(i+p, j+q)$$ ...
4
votes
2answers
1k views

Optimizing C++ equivalent of Matlab `filter` function

Minimum working example below. The Matlab filter function filters the input data x using a rational transfer function defined by the numerator and denominator ...
2
votes
1answer
708 views

Generate a random discrete signal

I currently have this code to generate a discrete signal with random amplitudes, but a fixed frequency: ...
5
votes
3answers
641 views

FFT Convolution

I have written the following routines to convolve two images in the frequency domain which are represented as 2d Complex arrays. How can I optimize my routines for better performance? ...
8
votes
2answers
142 views

20+ functions for generating different waveforms

I added a guard clause to the functions in scipy.signal.windows, but the way they are currently written means the same 11 lines are now repeated in every function. ...