Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
572 views

Two question about RBJ Peak filter

I'm new into DSP and Filters in general. Its the first step ahead I do from learning and using a 1-pole IIR basic Low Pass Filter. I'm about to implement for my VST audio application (using C++ and ...
0 votes
0 answers
23 views

Issue with cudafft library and fftshift on odd image dimensions

I'm facing with a code I'm implementing for an exam using the GPU. Specifically, the code I'm writing is in C++, and I'm using the CUFFT library to perform the Fast Fourier Transform (FFT). The ...
2 votes
2 answers
5k views

Create 16 bit sine and write to file

This seems a simple task, yet I am making some stupid mistakes I am not able to find. I create a sinus wave (integer) and then convert it to 16 bit char, little endian. Then I save to file and open it ...
1 vote
0 answers
17 views

Help figuring out how to extract audio content correctly from a file that produces spiky waveform with audible hiss/noise

I'm trying to extract PCM wave sequences from different files (files that are NOT audio files but contain audio data, and other data all in one file), and while this code does extract the expected ...
5 votes
4 answers
4k views

Find smoothed first derivative from signal with noisy slope

How can I get filtered first derivative from a noisy signal that has slowly changing slope in form of y=kx+b? k can slowly ...
1 vote
0 answers
211 views

How to implement STFT for processing audio [closed]

I should start this off by saying I’m a hobbyist and by no means a student. I’ve been reading “The Audio Programming Book”, and attempting to implement STFT on the stm32 based Daisy platform. In order ...
-1 votes
1 answer
4k views

Wavelet-based C/C++ Peak finding libraries

What wavelet-based peak finding functions are there for C++? I'm looking for something similar to: http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.signal.find_peaks_cwt.html. ...
0 votes
0 answers
159 views

Type 1 Chebyshev 3rd Order Lowpass Filter

I'm trying to implement a 3rd order Type 1 Chebyshev digital lowpass filter in C++. I've been having a lot of problems and I'm not sure why. I can plot the transfer function in MATLAB and see that it ...
9 votes
1 answer
9k views

Calculating the SNR of Audio Signal (Recommended Libraries)

Are there any open source packages or libraries available which can be useful in calculating the SNR(signal to noise ratio) of an audio signal. The input will be just an audio signal and I have to ...
1 vote
1 answer
63 views

Is the behaviour of the following filter plausible?

I've designed a filter based on this equation $$ E(u) = \frac{1}{2}\int_{\Omega} \left[(u-f)^2 + g(\lVert \nabla u \rVert)\right]dxdy $$ Euler-Lagrange equations in this case are (should be) given ...
14 votes
5 answers
35k views

Fastest implementation of fft in C++?

I have a MATLAB program that uses fft and ifft a lot. Now I want to translate it to C++ for production. I used OpenCV but I ...
0 votes
0 answers
137 views

Phase Vocoder Pitch Shift Phase Artifacts (Embedded C++)

I'm working on a phase vocoder pitch shifter running in C++ on an embedded microcontroller platform. I've successfully written the phase vocoder using the optimized FFT library, and it appears to be ...
1 vote
0 answers
126 views

Several Low pass filters generate offset when applied on an embedded system on C++

I need to implement a real time butterworth low pass filter on some data, I have an already implemented and tested butterworth function, but when filtering data from one specific variable I get an ...
0 votes
1 answer
147 views

Translating Matlab scrambler function to C

I am trying to implement the following matlab function in c: Mathworks scrambler Function Documentation This is the code I've written: ...
7 votes
5 answers
17k views

Recommended C/C++ General Purpose DSP Libraries

I am looking to transition some of my MATLAB algorithms to C/C++ for deployment on target (PowerPC and/or ARM). Mostly 1D FIR/IIR filter in this instance. In other domains, there are well-regarded ...
4 votes
2 answers
5k views

Parameters of Gaussian Kernel in the Context of Image Convolution

Hi Everyone i am new at image processing. I copy code from Code with C - Gaussian Filter Generation in C++, I have image $600 \times 480$ gray scale. What will be the value of standard deviation or $\...
1 vote
0 answers
62 views

Why filter-bank energies coefficients are same through the frame?

I am trying to implement MFCC's from scratch in C++. In each frame, I am processing real-valued data to construct MFCC vectors. Although I think that my implementation is correct, the testing result ...
1 vote
3 answers
1k views

True Peak detection II

As a followup to my True Peak detection question, I'm trying to implement a detection method by following this documentation using the Catmull-Rom interpolation method. What I've done so far can be ...
0 votes
0 answers
124 views

Biphase/Manchester floating-point decoder based on matched filter

I need to perform soft Viterbi decoding on a Manchester-encoded BPSK/QPSK signals. To that end, I need a floating point Manchester decoder. Most of the implementations I have seen operate on hard bits....
1 vote
1 answer
282 views

Popping sound after using bandpass filter

I'm trying to create guitar Wah Wah effect (basically band pass filter with dynamic frequency range). I'm using Steinberg SDK for it. I refactored this code to work in real time and it looks like this:...
2 votes
0 answers
869 views

How to implement an easy to use IIR-Filter in C/C++

Edited: I know there are some IIR filter implementation guides on the World Wide Web, however I can't find a simple guide on how to link simple PCM values to a digital filter. Most approaches are over-...
2 votes
1 answer
74 views

Audio, estimate codec's compression ratio only by content

I am about music audios. These can be compressed by different formats with different degree. (I.e. I don't mean the dynamic compression). After being compressed by a large degree (say 96kbps mp3) the ...
-1 votes
1 answer
511 views

Frequency from mic Raspberry Pi

I am working on C++ project based on Raspberry Pi. I have to make program that recognize siren of emergency vehicle(sound capture by microphone). I made a huge internet research and stopped with small ...
3 votes
1 answer
2k views

Signal processing in Python vs C++ (band-pass filter)

I have implemented Python signal processing code using a butter bandpass filter and order 3. It is working pretty well. I am required to implement the same signal ...
0 votes
0 answers
573 views

ICY feature detector and edge detector in opencv

I need to trace the internal feature boundaries of blobs (blood cells) in OpenCV to train a classifier. As a good reference from ICY in java, the following sequence of operations gives good, ...
4 votes
3 answers
2k views

Aquila DSP C++ Library - Wave file FFT analog frequency off by factor of 4?

I'm working with the Aquila C++ DSP library. I'm computing the FFT of a wave file (16 bit depth, single channel, 44100 sample rate). I am using a window size of 16384 to calculate the FFT spectrum. I'...
2 votes
1 answer
206 views

Signal to noise ratio for time series audio data

I am writing some software to benchmark an audio noise filtering method using SNR as an evaluation metric. One software component generates noisey audio by taking a clean audio file and a noise source ...
0 votes
1 answer
659 views

What does Cooley–Tukey FFT algorithm calculates in order to compute DFT

0 I'm relative new to this subject, I've watched many videos explaining FFT and DFT and read some articles. I wanted to see how I could implement FFT in C++ and then I found this code, it works but I ...
0 votes
2 answers
479 views

BPF Filtering with DSP IIR Realtime C++ filter library

I am working with complex samples, I have a main signal at 630KHz, my Fs is 1.26MHz and BW is 12.6KHz. If I plot a frequency-magntitude spectrum it looks like this: As you can see along with my main ...
2 votes
0 answers
220 views

Introducing Feedback to Miller Puckette's Time-Domain Pitch Shifting Algorithm without Discontinuities

I've implemented Miller Puckette's time-domain pitch shifting algorithm (http://msp.ucsd.edu/techniques/v0.11/book-html/node125.html) in PureData's help files in C++ (my code here: https://github.com/...
1 vote
0 answers
426 views

implement bandpass filter on complex valued signal? (C++)

I want to filter out complex valued samples - Bandpass filter. I have 100 complex samples and I wish to filter out a range of frequencies from it, as you can see in the result of the FFT, there are 3 ...
0 votes
1 answer
575 views

Biquad high-pass filter not working as expected

I'm trying to implement a high-pass filter using the the coefficients described in RBJ's well-known EQ cookbook (see https://www.w3.org/TR/audio-eq-cookbook/). However, when I run white noise through ...
1 vote
1 answer
215 views

Question regarding filter implementation - Audio EQ Cookbook

Some of you may know the infamous Audio EQ Cookbook. You can take a look here. We tried to implement the functions there to achieve a implementation for a Lowpassfilter. However, when we try to lower ...
11 votes
6 answers
5k views

How can I work on DSP using C/C++?

I have been working on MATLAB for signal processing for a while. Many companies from DSP for a communication background has asked me whether I know C/C++ very well. I am confused as to why the ...
0 votes
2 answers
265 views

Find the equivalent of this python remez specs in C++ remez or Matlab firpm

I want to start with that I am quite new in this community, so if this question does not belong here, please point me to the right place. Thank you! Background I am learning and writing a half-band ...
1 vote
1 answer
950 views

Moving average filter implementation in the floating point [closed]

I have following C++ implementation of the moving average digital filter. ...
0 votes
1 answer
51 views

Alg for identifying any temporal interfering signal

I'm a little bit on a loss at my search for an algorithm due to audio signals. I'm a sw-engineer with some basis knowledge in math here and there, know how to build and use FFT etc. but with no prof ...
0 votes
1 answer
1k views

Discrete implementation of the PI controller

I have been implementing discrete PI controller in the incremental (velocity) form in C++. I have been looking for the anti-windup mechanism. One idea which I have can be described by following ...
0 votes
1 answer
51 views

FFT Frequency-Spectrum has noise

I am plotting a Frequency-Amplitude Graph using openGL for the graph and Rosetta FFT implementation for the FFT calculations, I generated a 2 waveform, applied Hanning window, applied FFT and ...
0 votes
1 answer
214 views

getting different output when using FFTW3 Library than using Rosetta FFT

I have the following array containing sine waveform that I want to compute FFT: { 0.0, 0.114124, 0.370557, 0.0, -0.576201, -0.370557, 0.0, 0.0 }; When using FFTW3 ...
0 votes
1 answer
212 views

Generating a time domain signal using the fundamental frequencies

I currently have the power spectrum (in dB) of a signal through which I obtained the fundamental frequencies and amplitudes. My question is: how to generate a time domain signal using these amplitudes ...
0 votes
1 answer
326 views

image processing find liquid level (only with images processing, no AI)

I want some ideas to get the level of a water/liquor in a cup. i tried many ideas (contours, edges,...) but nothings is working. So any ideas that i can explore.
0 votes
1 answer
582 views

Programming the IDWT for image processing

I want to program the 2D inverse discrete wavelet transform (only 1 level) in the case of image processing. In the matlab website there's this diagram: now, I want to program the IDWT with haar ...
7 votes
2 answers
1k views

Why Is Non Linear Least Squares Method from MATLAB and Alglib Gives Different Results on the Same Data?

i'm trying to rewrite my Matalab prototype for some DSP to C++ and encountering a displeasing problem. I'm trying to fit data to a function $y = a * (\pi / 2 + arctg(b * x))$. In Matlab it works well ...
0 votes
1 answer
194 views

What's wrong with my FFT implementation?

I am implementing radix-2 DIT FFT (real only) in C++. For input sizes > 8 I can't seem to match the output of FFTW. Here's my implementation of the FFT: ...
1 vote
1 answer
159 views

Detect valve position without colors

I can't find a solution for my problem and I need your help. I have to create an application to detect if a valve is open or close like this : https://www.youtube.com/watch?v=VY92fqmSdfA Some ...
2 votes
2 answers
308 views

Fast algorithm for n-dimensional DCT

I need to implement an encoder which compresses a 5-dimensional structure of 10 bits values. Each dimension has between 4 and 12 elements. If a dimension ever has more than 12 elements, it is ...
1 vote
0 answers
464 views

2D Deconvolution using a non-gaussian mask using C++

I am currently working on a project, where we record an electron beam profile using a target. The obtained image is a result of convolution of the actual beam profile and the aperture wherein the ...
0 votes
1 answer
163 views

Understanding legacy code: Algorithm to remove radial lens distortion

The method below to remove lens distortion from a camera was written more than ten years ago and I am trying to understand how the approximation works. ...
1 vote
0 answers
519 views

FIR filtering with C++ to a sinewave

I am translating my FIR filter script from python to C++. My problem is that I am following a workflow which in theory should work but I get weird results. 1st. I create a signal from 1 and 50 Hz sine ...