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
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
148 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
64 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
49 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
38 views

Convolutions with shared memory in CUDA

I am writing a noise blur convolution kernel in CUDA ...
5
votes
1answer
83 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
118 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
248 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
770 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
494 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: ...
8
votes
4answers
468 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
378 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
92 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 ...
5
votes
2answers
4k 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
126 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 ...
4
votes
1answer
387 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
1k 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
122 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
240 views

Spectrum Analysis with Discrete Fourier Transform

Here is a simple implementation of the Discrete Fourier Transform: myFourierTransform.m ...
6
votes
2answers
951 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
114 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
753 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
188 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
207 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
272 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
134 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
149 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
114 views

Generating a sinusoid sound signal in Java

Is there any legroom left for optimization (without switching to C)? ...
1
vote
1answer
218 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
334 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
89 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
634 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
616 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
140 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. ...
2
votes
1answer
1k views

Encoding a list of frequencies as WAV audio

This code gets a list of signals with predefined frequency from struc.num I need to encode it to wave format, so i use this code. This works, but i dont sure it is a correct decision to encode like ...
0
votes
1answer
296 views

Iterative algorithm to convert a signal to Fourier series

I want to show you an iterative algorithm to convert a signal to a Fourier series. When I ran unit tests I gaven following results: one iteration: 1 sec, passed; ten iterations: 3 sec, passed. I use ...
9
votes
2answers
11k views

Averaging a signal to remove noise with Python

I am working on a small project in the lab with an Arduino Mega 2560 board. I want to average the signal (voltage) of the positive-slope portion (rise) of a triangle wave to try to remove as much ...
5
votes
4answers
7k views

Recursively Save Python Dictionaries to HDF5 Files Using h5py

I have a bunch of custom classes for which I've implemented a method of saving files in HDF5 format using the h5py module. A bit of background: I've accomplished ...
11
votes
1answer
4k views

Simple Phase Locked Loop

Here is a simple Phase Locked Loop, which is a circuit used in radio communications for synchronisation between transmitter and receiver. The loop works by calculating the (phase) difference between ...
4
votes
0answers
713 views

Reading cell array of vectors with h5py

I have a data stored in .mat files, each .mat contains a cell array of vectors of length ~70. I'm trying to read these .mat files in to Python with h5py, but reading just 1000 cells takes about 7 ...
5
votes
1answer
414 views

Bode plot filters implemented in JavaScript

The following code is my attempt to create an interactive bodeplot. I used JavaScript using d3.js, jQuery Mobile and math.js. The bode plot shows a lead lag filter in continuous time and several ...