Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

The tag has no usage guidance.

5
votes
5answers
6k 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 ...
3
votes
3answers
2k views

Vein extraction from this image

I have this image: What methods should I use to extract the veins from this image. Thank you.
3
votes
1answer
290 views

Smoothing 3D Data for the Second Derivative

I am not a signal processing expert and my feeble attempts at solving this problem have come up short. I have a C++ application which is being fed regularly-spaced (in time) 3D position samples. The ...
2
votes
1answer
690 views

removal of blackman harris window results in signal higher than expected

We are capturing data using a PX14400 adc. The samples are 16bit unsigned integer, 200M samples/sec, I data only. 100MHz bandwith. We have a cw signal at 51MHz, -11.4dBm. The -11.4dBm is measured ...
2
votes
2answers
823 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 ...
2
votes
2answers
2k views

Which filter for an audio equalizer

I’m new to DSP and I have to do an audio equalizer in c++. I did a lot of research about it and tried some stuff in the last month, but I’m a little overwhelmed with all those informations and it’s ...
2
votes
2answers
4k views

How to remove noise from this image without causing the crack to 'shrink'?

I am currently embarking on an image processing project to detect cracks on surfaces using OpenCV and Visual Studio via C++. I have tried writing my program and at the moment, I am stuck because I ...
2
votes
1answer
2k views

NORM_HAMMING2 vs NORM_HAMMING

I'm trying to use ORB features with a cv::BFMatcher. ORB is based on binary descriptors so HAMMING must be the choice, but I'm not sure I understand the difference ...
2
votes
1answer
1k views

how to smooth estimated velocity

I have a manipulator that provides the position and the velocity of its end-effector. The velocity is noisy. I've implemented a filter in C++ to determine the derivative of the position. In the below ...
2
votes
1answer
3k views

get convex hull of isolated shapes with openCV/C++

I have segmented CT images, something like the following one: I would like to get a convex hull that contains all the white regions. Something like this circle, but more fitting, and of course not ...
2
votes
1answer
300 views

Why is C++ so popular for Image Processing? [closed]

I have been a student of Image Processing for 3 years now and have been using C++ as the programming language to implement different Image processing operations. But I don't really why in particular C+...
2
votes
0answers
346 views

PortAudio: sound fade in/out by scaling sample data

I've done already some fade in or fade out effect in portaudio, but that is not working properly. My callback function: ...
2
votes
3answers
1k 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
1answer
878 views

VIbrato (pitch variation) function

I'm looking for an algorithm for Vibrato audio effect for a cross-platform C++ program of audio processing. Now I use the realization from Chaotic-DAW sources. The problem is that Chaotic-DAW has a ...
1
vote
2answers
955 views

C++ based FIR filter design using GNU Octave remez function [closed]

I am designing a system where I want a FIR filter coefficient generator feature. I try the remez.cc source file provided in the Octave Signal package. The source code for remez.cc is here. I have ...
1
vote
2answers
565 views

Distorted output of delay VST effect in C

I'm getting some odd results with some code I'm working on. Help me with the implementation of this delay effect? The code takes an input, adds delayed input to it and then passes it to the output ...
1
vote
1answer
120 views

Signal in frequency domain with OpenCV dft

I am experimenting with cv::dft: a 1HZ sinus signal is generated, and displayed in the frequency domain. But for some reason it hasn't got the maximum component at ...
1
vote
2answers
444 views

Power spectrum of a pure sine problems

I am writing a C++ program to use to analyse oscillations and create a power spectrum. I am using FFTW3. To test the system, I am using a perfect sine function. But no matter what parameters I try, ...
1
vote
1answer
3k views

Basic FIR Filtering with audio buffer in C++

I am willing to implement a basic FIR filter using C++ and JUCE. I wrote this simple algorithm using the information I found in the DSPGuide, but I only seem to get a variation in volume for all the ...
1
vote
1answer
3k 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
1answer
753 views

normalize fft produced by fftw_plan_dft_r2c_1d

fftw_plan_dft_r2c_1d takes an array for real numbers and produces an array of complex numbers 1/2 the size of input array + 1. per fftw's website: As a result ...
1
vote
1answer
973 views

Image gradient light-to-dark, dark-to-light

From link: Black-to-White transition is taken as Positive slope (it has a positive value) while White-to-Black transition is taken as a Negative slope (It has negative value). So when you ...
1
vote
1answer
1k views

FFTW log-log plot

I am taking a real-time fft of an audio signal using fftw library. I take the output of the ...
1
vote
1answer
139 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 ...
1
vote
0answers
33 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 ...
1
vote
0answers
82 views

How to generate the amplitude of a signal with a certain power spectral density?

I am a newbie. If I posted a question someone else already asked, please forgive me. Thank you! Now, I have a power spectral density named $P(f)$ as a function of $f$. Let's say this function is ...
1
vote
1answer
1k views

Using a Kalman filter to predict samples between measurements

(cross posted from stack overflow) I have a dataset where measurements were taken at 10 Hz, and I am trying to use a Kalman filter to add predicted samples in between the measurements, so that my ...
1
vote
0answers
1k views

Line Detection with OpenCV

I'm trying to use the native functions of OpenCV HoughLines and HoughLinesP to detect the lines from an image. The Canny edge output of that image is the folllowing: The problem is that the OpenCV ...
1
vote
0answers
374 views

Upsampling with FIR filter causing discontinuity at start of new buffer [closed]

I have implemented an oversampling algorithm for an audio signal in C++ which is producing a distortion of the signal at the start of a buffer. The algorithm is wrapped in a class with methods for up ...
1
vote
0answers
41 views

Get level of wellness in a cascade classifier using LBP

I'm currently working in a Lolipop LBP cascade detector using OpenCV. The training is correctly done and the cascade classifier detects the sticks of the Lolipops correctly but with some minor errors. ...
1
vote
0answers
1k views

Implementing a 2d butterworth filter for image processing?

I am at the moment trying to implement a bandpass butter worth filter which i then can use to apply on my original image. Problem is though My implementation of it using OpenCV doesn't seem to be ...
1
vote
1answer
451 views

Creating a convolution kernel from filter description

I am not quite sure whether the question I am stating is right, or if I am trying to combine two not related topics but here it comes.. I am trying implement and apply a contra harmonic mean filter, ...
1
vote
0answers
204 views

Is there any library for convolution reverb software for Visual Studio besides Freeverb?

I am currently working on a simulation of a virtual scene. I calculate the IR of the direct path and the early reflections and want to convolute them with the input signal. My problem now is that ...
1
vote
2answers
1k views

Decibels conversion into amplitude ratio

I want to convert db into amplitude ratio. I did some research but I only found online convertor, and I don't understand what's on Wikipedia very well... Here is a little of backstory : I am a ...
0
votes
1answer
84 views

How to implement the imaginary part of FFT equation applied to a signal in computer/C++?

I am trying to apply FFT on a time domain signal in C++, however I am having trouble with the imaginary part i.e square root of -1. In the FFT equation we have, $$X =\frac{1}{2\pi}\int_a^b x(t) \ e^{...
0
votes
2answers
337 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
1answer
73 views

DSP using audio IO from PC using C++

This is my first question on dsp. I am looking for something very simple here and I am sure there are libraries that will do pitch recognition and FFT but my requirement is very simple. I have a PC ...
0
votes
1answer
400 views

How can i measure soundcard latency?

I want to write sonar/radar like sample application. For sake of simplicity (and not to use Arduino and specialized RTOS) - I simply used using audio in/out analog ports of a motherboard integrated ...
0
votes
1answer
63 views

Attempting to reverse mid conversion

I'm new to to DSP in general and have been trying my hand at making some very simple VST's just for practice purposes. I am trying to convert the stereo channels into Mid (in the left channel) and ...
0
votes
1answer
26 views

How to change the shape of a function generator keeping the rate?

I'm making a sort of Envelope Function Generator. At the moment, I'm calculating only the the "rise" stage, which goes from 0 to 10 V; than, brutally, I back it to ...
0
votes
2answers
48 views

How do you properly organize data to compute multiple (independent) recursive filters at the same time taking advantage of SIMD instructions?

I'm processing multiple (independent) Exponential Moving Average 1-Pole filters on different parameters I have within my Audio application, with the intent of smooth each param value at audio rate: <...
0
votes
1answer
95 views

Windows Audio WAVEFORMAT buffer BYTE to 16-bit int

I am trying to understand audio-buffer processing at the low-level for the first time. I have the following C++ code copying WAVE-format byte data from capture buffer of Window Core Audio (*ppData in ...
0
votes
1answer
1k views

What exactly is “sparse representation”? [closed]

I saw a recommended topic for the final project in my university called "dsp and dip applications using sparse representation techniques (MATLAB, C, C++)". I consider taking this topic as my final ...
0
votes
1answer
429 views

Block normalization of histogram of oriented gradient

I am a beginner in image processing. I have some questions regarding HOG. https://www.learnopencv.com/histogram-of-oriented-gradients/ From this website, it mentioned that each element inside the ...
0
votes
1answer
382 views

PortAudio: how to generate multiple sounds

I have simple wave generator in PortAudio. I'm creating single sine wave, and then I use a lookup sine to play it. Now I've stucked here. I have no idea how I can add another sine sound. Is it ...
0
votes
1answer
548 views

Why entropy is undefined in low contrast image

I am trying to measure contrast of image by entropy of histogram of image. Code for computing entropy ...
0
votes
1answer
598 views

Implementation of the filter function (Matlab) C/C++

I am trying to apply some filtering in C/C++ code, I have designed an algorithm using Matlab and it works well, so now I am moving it to native code. I am ...
0
votes
2answers
1k views

Parameters of Gaussian Kernel in the Context of Image Convolution

Hi Everyone i am new at image processing. I copy code from this website, I have image $600 \times 480$ gray scale. What will be the value of standard deviation or $\sigma$? What will be the value of ...
0
votes
1answer
44 views

A PID that can handle 2 inputs for my application

I am currently working on a Drone that navigates to different points that it detects on the ground. To go from one point to another in a smooth manner, I am employing a PID looks at the error between ...
0
votes
1answer
179 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 ...