Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

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
10 votes
2 answers
407 views

Image Stitching using SIFT Keypoint Descriptor in C++

This is a follow-up question for SIFT Keypoint Detection for Image in C++. With the detected SIFT keypoints of images, image stitching is possible to perform. In this post, the first step is to ...
JimmyHu's user avatar
  • 7,575
2 votes
1 answer
335 views

General Two-dimensional Elliptical Gaussian Image Filter in C++

This is a follow-up question for Two dimensional gaussian image generator in C++, Three dimensional gaussian image generator in C++, General Two-dimensional Elliptical Gaussian Image Generator in C++ ...
JimmyHu's user avatar
  • 7,575
14 votes
5 answers
2k views

I implemented FFT in C

I wrote Cooley-Tukey's FFT algorithm in C. And I want to know how safe is this code? Is it just trash? How can I make it more memory safe? ...
RudraSama's user avatar
  • 181
5 votes
2 answers
153 views

N-dimensional bilateral_filter Template Function Implementation for Image in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++ and bilateral_filter Template Function Implementation for Image in C++. The N-...
JimmyHu's user avatar
  • 7,575
1 vote
0 answers
72 views

Mismatch Between Frequency Response and Eigenvalue-Based Natural Frequency in MATLAB for a 5-DOF System with Frequency-Dependent Stiffness

I am working with a mechanical system that has five degrees of freedom (a composite plate), and I am trying to compute its frequency response, time-domain response, and natural frequencies. I have ...
AaronTBM's user avatar
  • 119
7 votes
1 answer
245 views

bilateral_filter Template Function Implementation for Image in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. Bilateral filter is implemented in this post. By Wikipedia, the bilateral ...
JimmyHu's user avatar
  • 7,575
8 votes
2 answers
365 views

Determining Error Rate of Phase Shift Keying via Monte Carlo Simulation

My program calculates the symbol error rate for various signal-to-noise ratio (SNR) and modulation orders using Monte Carlo simulation on Phase Shift Keying (PSK). How can it be improved? ...
unique's user avatar
  • 235
1 vote
0 answers
124 views

difference_of_gaussian Template Function Implementation for Image in C++

This is a follow-up question for conv2 Template Function Implementation for Image in C++ and imgaussfilt Template Function Implementation for Image in C++. I am trying to perform Difference of ...
JimmyHu's user avatar
  • 7,575
4 votes
2 answers
430 views

convn Template Function Implementation for Image in C++

This is a follow-up question for conv2 Template Function Implementation for Image in C++ and conv3 Template Function Implementation for Image in C++. I am trying to perform n-dimensional convolution <...
JimmyHu's user avatar
  • 7,575
2 votes
1 answer
77 views

conv3 Template Function Implementation for Image in C++

This is a follow-up question for conv2 Template Function Implementation for Image in C++. Besides two-dimensional convolution, I am trying to implement three-dimensional convolution for 3D image in C++...
JimmyHu's user avatar
  • 7,575
1 vote
0 answers
76 views

Two Dimensional Discrete Fourier Transform Template Function Implementation for Image in C++

This is a follow-up question for An Updated Multi-dimensional Image Data Structure with Variadic Template Functions in C++. For learning purpose, I am trying to implement two dimensional discrete ...
JimmyHu's user avatar
  • 7,575
3 votes
3 answers
455 views

1D Convolution vector multiplication in ANSI C code

I have a code snippet here about 1D convolution in pure ANSI C code. Question: Is this most optimized C code, or can it be done in a more optimized way? In my ...
euraad's user avatar
  • 183
16 votes
7 answers
4k views

Image Processing Application in C

I'm making a image processing application in c from scratch using P6 ppm images, I want some input on my code before I start adding more features to prevent it from falling apart if it's not well ...
Ishaan Vatus's user avatar
8 votes
2 answers
557 views

Fourier Series of a given function

This is a very simple code that expresses a function in terms of Trigonometric Fourier Series and generates a animation based on the harmonics. I would like to know some ways to improve the ...
Lipe's user avatar
  • 83
6 votes
2 answers
611 views

Drift correction for sensor readings using a high-pass filter

An embedded project my team is working on is having issues with sensor drift over time. To solve this, I thought it might work to use a high-pass filter, since the portion of the signal that we care ...
Juniper Mills's user avatar
4 votes
1 answer
192 views

Ways to optimize my FFT impementation's performance

I cooked up a FFT code in c++ for calculating with arbitrary data size. The czt function is copied from GNU octave's czt.m. Here'...
Abdur Rakib's user avatar
5 votes
3 answers
505 views

Generic exponential damping to smooth noisy signals

Exponential damping is a type of "moving average", but it's not an arithmetic mean. The latter has the disadvantage that it requires storage of the last N ...
Oliver Schönrock's user avatar
2 votes
1 answer
349 views

Implementation of versatile IIR digital filter in C++

I have realized that all the digital filters of the IIR type have the same structure. They are described by difference equation in following form: $$ y(k) = b_0\cdot x(k) + b_1\cdot x(k-1) + \ldots +...
Steve's user avatar
  • 355
2 votes
1 answer
247 views

Implementation of the square root for real time application

For the real time control software I need square root calculation. I have heard that the sqrt function from the standard library isn't good choice due to the unpredictable number of iterations used ...
Steve's user avatar
  • 355
4 votes
1 answer
232 views

Parallel 3D Discrete Cosine Transformation Implementation in Matlab

I am trying to implement 3D Discrete Cosine Transformation calculation in Matlab with parallel computing parfor. The formula of 3D Discrete Cosine Transformation is ...
JimmyHu's user avatar
  • 7,575
7 votes
5 answers
2k views

Implementation of the trigonometric functions for real time application

I have been developing a real time application in C and I need to calculate sine and cosine of a given angle in radians. In respect to the fact that the application is a real time application the ...
Steve's user avatar
  • 355
0 votes
1 answer
515 views

How could I make FFTW Hilbert transform calculate faster? [closed]

I'm using the Hilbert transform function from the FFTW source. Because I am going to use it in my DAQ with data streaming mode. The function is working fine but the calculation speed is slow which ...
Kevin's user avatar
  • 45
5 votes
2 answers
516 views

Moving average algorithm that preserves the integral and number of points

I need to smooth a noisy signal. I think that the moving average algorithm would be fine. However, I want the following conditions to be satisfied: The total integral (the sum of all values) before ...
LRDPRDX's user avatar
  • 941
4 votes
2 answers
215 views

calculation code to prevent FIFO overflow during data streaming

I am using a dual channels DAQ card with data stream mode. I wrote some code for analysis/calculation and put them to the main code for operation. However, the FIFO overflow warning sign always occur ...
Kevin's user avatar
  • 45
4 votes
1 answer
1k views

Get signal name from signal number

I am trying to get a signal name to print when getting a signal number. I actually have : ...
Qwark's user avatar
  • 43
4 votes
0 answers
1k views

Slow copying of memmap array to numpy array

I have multiple binary (structured) file, each of 2GB, which I am currently reading in pair, using memmap to cross-correlate the same. I want to minimise the time required by this IO process, in the ...
Pavan Uttarkar's user avatar
2 votes
1 answer
76 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 ...
user3053970's user avatar
4 votes
2 answers
2k 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,...
learningthemachine's user avatar
5 votes
1 answer
350 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. ...
Foad's user avatar
  • 379
5 votes
1 answer
2k 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-...
Lewistrick's user avatar
6 votes
1 answer
4k 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 ...
learningthemachine's user avatar
4 votes
1 answer
475 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 the ...
Beginner's user avatar
  • 205
6 votes
2 answers
291 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? ...
Luke Gary's user avatar
  • 215
17 votes
3 answers
3k 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 ...
tjwrona's user avatar
  • 539
10 votes
1 answer
4k 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. ...
Lin's user avatar
  • 357
3 votes
1 answer
1k 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 ...
Matthew Anderson's user avatar
2 votes
0 answers
101 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 '...
ntakouris's user avatar
  • 121
2 votes
0 answers
508 views

Convolutions with shared memory in CUDA

I am writing a noise blur convolution kernel in CUDA ...
Jsevillamol's user avatar
5 votes
1 answer
1k 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 ...
Arhum Ishtiaq's user avatar
9 votes
1 answer
295 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....
user14717's user avatar
  • 775
3 votes
3 answers
174 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 \$\...
user14717's user avatar
  • 775
2 votes
4 answers
987 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 ...
markzzz's user avatar
  • 165
1 vote
2 answers
101 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: ...
markzzz's user avatar
  • 165
2 votes
0 answers
2k 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: ...
Gilfoyle's user avatar
  • 1,167
2 votes
2 answers
539 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: ...
markzzz's user avatar
  • 165
9 votes
4 answers
681 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 ...
チーズパン's user avatar
5 votes
2 answers
787 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 ...
Jonas Schwarz's user avatar
2 votes
1 answer
159 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 ...
Cunningham's user avatar
10 votes
2 answers
20k 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. ...
MeteHan's user avatar
  • 350
4 votes
2 answers
193 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 ...
Mathieu's user avatar
  • 251