Questions tagged [c++]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
38 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 ...
3
votes
3answers
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'...
0
votes
1answer
276 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
1answer
166 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 ...
10
votes
6answers
3k 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 ...
1
vote
1answer
124 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:...
0
votes
2answers
39 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
1answer
48 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 ...
0
votes
1answer
123 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 ...
1
vote
1answer
107 views

Moving average filter implementation in the floating point [closed]

I have following C++ implementation of the moving average digital filter. ...
0
votes
1answer
46 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
1answer
508 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, ...
0
votes
1answer
93 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
1answer
36 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
1answer
35 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
1answer
84 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
1answer
71 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
1answer
33 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
1answer
464 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 ...
4
votes
2answers
983 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
0answers
26 views

What is the best way to spatialise a real-time stream of a speech? Developing a C++ engine

I'm working on a mobile application in C++. The app brings listeners to a virtual room to listen to real-time streams, such as interviews, talks, lectures. The idea is to make sound immersive, to give ...
0
votes
1answer
130 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
1answer
130 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
2answers
183 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
0answers
70 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
1answer
73 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
0answers
141 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 ...
0
votes
1answer
44 views

gnuradio - flowgraph with cpp

I build a flowgraph in gnuradio, generated python code, change a little and run it using python. My question is, does building the flowgraph in cpp will provide better results (time)? (in other words ...
0
votes
1answer
98 views

Cascading first order digital filters in C++

In a related question a probable solution was given to build a first-order digital filter and then cascade three of them in order to turn white noise into pink. I have applied the C++ as follows but ...
0
votes
0answers
123 views

FFTW audio artifacts when modifying magnitudes in frequency domain

I'm currently working with FFT (FFTW3) that I'm using to apply treatments on audio files frequencies. The Forward/Backward test is passed, since I can get the exact same soundfile when processing ...
1
vote
0answers
108 views

(Newbie question) Calculation DC-offset and RMS

Being a newbie on this topic I beg you to be indulgent to me if my questions should be kind of "too" simple ;-) For doing automatic analysis on my audio material I started calculating the ...
1
vote
3answers
126 views

Sampling a low-frequency sound doesn't work at some sampling rates

When sampling a low-frequency sound (like a 55Hz sine wave) I hear an additional high frequency sound at certain sampling rates, but not at others. This happens in Audacity and in my own program. For ...
0
votes
1answer
335 views

How does window length influence cut-off frequency of filter and group delay?

I'm attempting to interpret the following function. To my understanding, this aims to implement an FIR low-pass filter with a Nuttall window. Then, it filters the signal by a simple application of the ...
4
votes
4answers
8k 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 ...
0
votes
1answer
85 views

How does this represent a low-pass filter?

I am faced with the following code snippet to get an understanding of a F0 estimation algorithm (DIO). Have a quick look below: ...
0
votes
1answer
3k views

What does opencv `mean` function do when passing a mask of zeros?

INTRO I am looking at this project to implement some changes. The project is written in C++ using openCV library. Its goal is to detect cars in parking area to calculate the number of free spots. It ...
-1
votes
1answer
1k views

How to Find spectral Peaks from 2D array of Spectrogram? [closed]

I have computed a Spectrogram 2D array as : How to develop a spectrogram (2D array) from audio signal? Now, I want to find spectral peaks to find the respective temporal displacement. In python using ...
0
votes
2answers
899 views

How to develop a spectrogram (2D array) from audio signal?

I have developed a spectrogram in Python using Scipy.Signal.Spectrogram. But I need a complete understanding of data. Here I am not asking about plotting and color ...
1
vote
1answer
90 views

dB SPL readings differ from external sound level meter?

I'm trying to write a program that takes values from a MEMS microphone and calculates the dB of the incoming audio data. The microphone i'm using is this: https://www.mouser.es/datasheet/2/218/...
0
votes
1answer
47 views

Detecting peak value on realtime IMU data stream

I'm using Qt C++, QCustomPlot to read and display realtime value from an IMU. This is how I set the realtimeDataSlot: ...
1
vote
1answer
139 views

Is a "Spectral Tilt Filter" the best way to get an arbitrary slope and cutoff LPF?

I need an arbitrary slope audio LPF for which both the cutoff frequency and slope in dB/oct can be smoothly modulated in real time. Is the "Spectral Tilt Filter" described by Julius Smith the correct ...
1
vote
2answers
2k views

I wish to create a GNU Radio program in C++ that doesn't need GRC or Python, is there a reference or template for this?

I want to create a functionally equivalent C++ file to the Python top_block.py file that is generated by GRC when executing a (blank example) flow chart. I know that C++ can be used to define blocks ...
3
votes
1answer
73 views

What did I do wrong with this simple filter build?

I tried to put everything I have learned from people here together to code my first filter from scratch. Unfortunately, it didn't go well and I'm not getting the expected output. The math/code became ...
4
votes
1answer
1k 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
0answers
23 views

How to find location of minimum dimension of contour using opencv?

suppose this is our input image and now we have to detect the point of minimum dimension, which I show as the red dot in an output image
7
votes
1answer
7k 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 ...
0
votes
0answers
46 views

SIFT between 1 image and dataset (2 images)

I use SIFT, and I want to find the angle of inclination of an image compared to two reference images, in short: I have 3 images : Image x: input image Two images 1 and 2, reference images that are ...
12
votes
5answers
21k 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
1answer
60 views

How to synchronize audio and video streaming for not fixed FPS streaming?

It's a 3-stage process. In the first stage, a video (with audio) is recorded at a fixed 25 FPS rate. In the second stage, it's demuxed in two different channels and the video is processed. In the ...
1
vote
1answer
150 views

Partitioned overlap-add convolution - strange behavior at buffer boundaries

I've implemented a convolution reverb that operates in real-time, one audio buffer at a time (using FFTS for the fft bits). However, there's some strange behavior at the start of every buffer. ...