/r/DSP

Photograph via snooOG

Anything related to digital signal processing (DSP), including image and video processing (papers, books, questions, hardware, algorithms, news, etc.)

Interesting technical papers or articles are particularly welcome!


Recommended subreddits

/r/DSP

22,807 Subscribers

0

Would I Be Able To Get Into DSP With A CS Bahcelors?

I love music ans math and also programming. And I also love synths.

Most of the other math heavy fields like MI and cryptography require a PhD or an MS, but what about DSP?

6 Comments
2024/11/10
02:36 UTC

3

Minimum Shift Keying modulator error - what could be causing this?

Greetings all,

I’m working on an open source minimum shift keying (MSK) transceiver. It is written in VHDL and targets the PLUTO SDR.

Here’s the repository: https://github.com/OpenResearchInstitute/pluto_msk

Spectrum looks great, and transceiver works solid, most of the time. Ever so often, though, the main lobe bifurcates into two lobes, with a new null at the center frequency. And, the sidelobes gain energy. Then it goes back to the “correct” spectrum.

The receiver (in loopback) fails during this time, as expected, since the waveform is obviously not right.

We’re adding integrated logic analyzers (ILAs) to the design to get more visibility, but code reviews have not turned anything up yet.

Based on the spectrum of the output of the modulator, does anyone have any advice on what to look at? I was thinking maybe the phase information got briefly inverted. On the list of things to do is to go to MATLAB and see if the “wrong” spectrum can be created from the current model.

I wanted to ask here first because someone might recognize this pattern as a particular error, and narrow things down quite a bit.

The “split” is not periodic. It’s intermittent. It could be something outside the MSK block. There’s a transceiver reference design from Analog Devices, and we are using the one for the PLUTO. Our MSK block is stitched in to the usual place between the DMA controller and the rest of the transmit chain. Digital loopback and RF loopback both work - as long as the modulator doesn’t do this strange main lobe splitting thing.

-Abraxas3d

1 Comment
2024/11/09
17:34 UTC

1

Please check my convolution

I am using armadillo library here. I have written 1d convolution function below. Kindly say any improvement here that is proper way to perform convolution on computer. I see there are some different approach in mathematical formula of convolution and how it is implemented (like padding). I am here writing convolution for first time and want to do it properly. I can clearly see difference in formulation of this operation vs the implementation on computer and there is a proper addressable gap

void conv1D(row_space signal, row_space kernel)
{
signal.insert_cols(0, 1);
signal.print("padded signal");
row_space response(signal.n_cols+kernel.n_cols);
for (int n = 0; n <signal.n_cols; n++)
{

 float sigmasum = 0.0f;

for (int m = 0; m < kernel.n_cols; m++)
{

if(n-m>=0)
sigmasum += (signal[n - m] * kernel[m]);

}
response[n] = sigmasum;
}

response.print("response");

return;
}
0 Comments
2024/11/09
16:32 UTC

5

Realtime linear convolution plugin(GPU)

Hi all. I made a realtime convolution plugin that runs on gpu(nvidia only). It is still an early build. If anybody has an idea how to improve it let me know. On this repository there is readme on how to use it and a video for demo. Apple silicon and linux will come in future. https://github.com/zeloe/RTConvolver

0 Comments
2024/11/09
15:32 UTC

1

Filter Banks for Hearing Aid

Hi everyone, me and my team we are making a hearing aid using esp32 as we would use Ai models for noise cancellation and echo cancellation

and we want to make some filterbank so that we can take the hearing test and apply the different gains to the input sound

we don't know how to make the filterbanks, I tried different methods (using python first to try) like FFT, FIR, IIR but there is a problem where the different gains make a phase difference between the input and output

so any idea how we can make a filterbank that works on esp32 or where I can look for

2 Comments
2024/11/09
15:02 UTC

25

Separating music into notes and instruments (audio source separation) - details in comments

8 Comments
2024/11/09
12:49 UTC

10

Any interest for a cmake Faust-to-C++ module

I made a cmake project with a function that takes a faust dsp source file and generates a library with structs of all the parameters, and some other utility functions to make it easier to integrate with for example JUCE and ImGui without manually typing in all the boilerplate code. The Faust architecture files are really outdated, rigid and generally difficult to use outside of the beaten path, so this really saves time and labor for me when integrating Faust with Juce and ImGui.

If there is interest for it I could spend a little more time to release it on github. So holler here if it is something that would help you out and I will make it available.

14 Comments
2024/11/08
23:04 UTC

4

How to divide a transfer function into 2 transfer functions half the size for an FIR filter?

I'm struggling to Google this, possibly because my terminology isn't quite on point.

I'm using a piece of hardware which can process FIR filters up to 4096 taps in length at a time. The documentation says that to process longer filters, one first needs to divide the transfer function into multiple smaller filters. To quote, for an 8192 tap filter:

  1. Divide the transfer function of an 8192 FIR filter into two 4096 FIR filters:

H(Z) = b0 + b1Z^(-1) + b2Z^(-2) + ...........b4095Z^(-4095) + b4096Z^(-4096)b4097Z^(-4097) +........b8191Z^(-8191)

= b0 + b1Z^(-1) + b2Z^(-2)+ ...........b4095Z^(-4095) + Z^(-4096)(b4096 + b4097+ ........b8191Z^(-4096))

I don't quite follow. Does that change how I calculate the filter coefficients in the first place? Or is it the case that the filter coefficients are the same, just split across the two halves of the computation?

It then goes on to say that you simply add the partial sums of each calculation - that bit seems straight forwards enough.

The datasheet reference is here, at the bottom of page 1736: https://www.analog.com/media/en/dsp-documentation/processor-manuals/adsp-2156x_hwr.pdf#page=1736

7 Comments
2024/11/08
18:14 UTC

8

2.5 GPA but passionate about Grad School

I graduated from Cornell with a 2.5 GPA in ECE and was around a B student in my DSP classes. I didn't really take school seriously but I really like this subject and have been working on a personal OFDM software radio for the past year. Its been tough to find entry level jobs so I was wondering if there was a path for me to get into grad school with such a low GPA

4 Comments
2024/11/08
01:51 UTC

8

What next for me in my DSP learning journey? EECE 2026

Hi, I am an Electronics major set to graduate in 2026. In my last two semesters I took Signals and Systems and DSP-I. In my next semester I will have to take DSP-II. I have more or less completed these books for reference:

  1. Oppenheim Signals and Systems

  2. Oppenheim Discrete-time Signal Processing

  3. Oppenheim and Schafer - Digital Signal Processing.

In my next semester syllabus the topics mentioned in the syllabus are as follows:
Multirate Signal Processing, Decimation and interpolation, analysis and synthesis filter banks; QMF, M-Channel filter banks; paraunitary filter banks and perfect reconstruction; Wavelets and Multiresolution Signal Analysis; multiresolution decomposition of signal space, analysissynthesis filter banks, orthonormal wavelet filter banks, Haar wavelets, Daubechies and spline wavelets; time frequency decomposition, short term Fourier transform and Wigner-Ville distribution. Sparse Signal Processing, compressive sensing, l1 -norm regularization, basis pursuit, restricted isometry property, greedy algorithms. Graph Signal Processing, motivation from big data and large scale sensor network applications; adjacency and Laplacian matrix, graph Fourier transform, convolution on graphs, filter banks on graphs.

For reference, I am currently trying to set uo my career in Artificial Intelligence. If that doesn't work out I'd like to have some options in Signal Processing since I like this too. Currently I see myself as a hobbyist in electronics even though it is my major.

So what are the options for me if I just wanna study DSP (I am a highly theoretical person so studying a lot is my cup of tea lol) and maybe get a job?

7 Comments
2024/11/08
01:31 UTC

4

Frequency spectrum in interpolation

Hi. I'm trying to understand interpolation from the book "Understanding Digital Signal Processing" by Richard Lyons and have some confusions.

https://preview.redd.it/s2ima2jooizd1.png?width=1096&format=png&auto=webp&s=f02ef58ce3bcd3bbd2174cf4a3a59b587c4a0065

My first question is how the spectrum in b is different from a. As in a as well the repilcations are present at multiples of fs and also in b.

The author use the terms replications and images to different them, but I can't see how they are differet.

My second question is that in c a low pass filter is used to suppress the intermdiate replications. But how is the fsnew image retained even after low pass filter. As according to my understanding the low pass filters are not periodic. Shouldn't the fsnew image should also be suppressed after passing through the low pass filter??

Any clarification would be much appreciated. Thanks.

3 Comments
2024/11/07
17:52 UTC

3

Advice Needed on Microphone Array for Sound Source Localization Thesis

Hello everyone,

I’m working on my undergraduate thesis on sound source localization, and I'm currently in the preparation stage. I plan to use the MUSIC (Multiple Signal Classification) method with a 4-microphone linear array and an STM32H747i Disco microcontroller.

I’m wondering whether I should purchase a commercially available 4-microphone array, or if I should use four separate digital microphones and assemble the array myself. So far, I haven't found a suitable commercial linear array, so there's a possibility I may need to go the DIY route. If I do, what key factors in terms of DSP should I consider, especially regarding timing issues like microphone delay, synchronization, and signal processing?

I’m relatively inexperienced with STM32 and DSP, so I’d really appreciate any advice or insights from those who’ve worked on similar projects.

Thanks in advance for your help!

18 Comments
2024/11/07
12:42 UTC

5

Efficient High Order Downsampling Suggestions?

Hi everyone. I have been working on a receiver where I need to carry out a down sampling operation with a factor of 356.

Since this rate change is quite high, I didn’t even think about any standard filtering operation and went straight to a CIC solution. Even though it achieves an acceptable resource usage (with some regrettable adder widths) I am curious about other possible solutions.

Does anyone have a down sampling approach other than CIC for such extreme orders?

6 Comments
2024/11/06
19:48 UTC

10

Filtering in C

Hello, i'm building a DSP with a STM32G4. I first try my filtering algorithm on python to see if it's working correctly, but the thing is, it is not. I want to have a 4th order Butterworth LPF by using biquad filters. To do so, i just cascade 2 filters. But the thing is, i was expecting my slope to be at 12dB/octave with my 2nd order, and 24dB/octave for my 4th order (with two LPF cascades). But the thing is: i have a weird 3dB/octave in each case. What i'm doing to mesure the slope, is that i generate two sine, one at 4000Hz and the other at 8000Hz, then i calculate the peak value for both filtered sine (the cutoff frequency is 100Hz). To do my cascading, i tried putting to the power of 2, the transfert fonction in Z domain from my 2nd order biquad filter. I also tried to apply the filter two time (the second time on the output of the first time). I tried with biquad coefficient i calculated but also with coefficient that i took from a biquad calculator from the internet. I don't really know what to do at this point, Can you help me please? I can upload my python on my github, if you need to see what i've done (this code is for testing propose so it is not optimized and all).

4 Comments
2024/11/04
07:26 UTC

18

sharp frequency clarity by masking an odd-symmetric windowed spectrogram from a flat-top (for amplitude accuracy) spectrogram (demoed using an audio to midi script basiliotornado and i made)

10 Comments
2024/11/04
05:49 UTC

5

What is the proper way to synchronize two very similar but not identical periodic signals that have been measured at different times from the same system?

You measure something periodic once and then you measure the same thing again from the same system for example the next day. The two data sets are slightly different due to the measured phenomenon itself slightly changing. The phases in the FFTs are also not comparable since the measured data sets have different time shifts (the starting times of the measurements were not in sync with respect to the period of the measured phenomenon).

What is the proper way to synchronize the data sets with respect to the period of the measured phenomenon so that one can examine how much the phases of the spectral components have changed between the two measurement events? Amplitude change is easy to assess, but phase change seems to be tricky.

Should one merely adjust the phase of the fundamental frequency in the frequency domain such that the phase matches the other data set and then adjust the phases of other frequency components by the same amount (same amount as time and not as phase angle)?

11 Comments
2024/11/03
13:55 UTC

2

Speech denoising

Hello, I have a case that I want to get advised about speech denoising. When there is no single characteristic of a noise in environment, speech could be hard to be heard because of background noise. Noise could be sometimes louder than speech. It's seems that it's not possible to apply any threshold. There is only one channel of microphone in this case also. Using any ML technic could be hard to apply because of a low speed of pld application. What type of algorithm should be used in terms of speech processing and active noise cancellation?

8 Comments
2024/11/03
07:46 UTC

1

Extract 3 panned mono audio signals from a single stereo signal?

This isn't something I need to do, but I've been wondering if it's possible. Let's say I take 3 mono audio signals, pan them to various places, and combine them to a stereo signal. Then I want to extract each original mono signal. Any ideas how this might be done?

To maybe make it more possible, what if I know one signal is panned dead center? If that's not enough, what if I know the pan location of all 3 signals?

I wonder if something like ICA would do well here. The issue is that the audio signals will not be independent in a real world situation, since the signals might be multiple musicians playing together.

Another interesting thing, I can manipulate the volume of each component signal somewhat in the stereo mix. If I adjust the volume and pan of L and R independently, and the stereo width of the whole thing, I can make some changes, like lowering or raising the volume of one of signals, while also changing the stereo position of another. It isn't possible to affect only 1 of the signals at a time though just using volume and panning.

7 Comments
2024/11/03
00:04 UTC

6

Why is my oscillator an entire 2 semitones off? [C++]

I'm new to the concepts of DSP and ive just learned about phase accumulators so naturally im trying to make my first digital oscillator in juce

what Im about to show may disturb some viewers but right now im just trying to learn the basics so im going about it in a not so clean fashion

    float lastTime = 0;

    for (int channel = 0; channel < totalNumInputChannels; ++channel)
    {
        auto* channelData = buffer.getWritePointer (channel);

        Accumulator = 0;

        for (int sample = 0; sample < buffer.getNumSamples(); sample++)
        {
            float time = sample / getSampleRate();
            float deltaTime = time - lastTime;
            lastTime = time;
            float phase = deltaTime * 440 * 360;

            Accumulator += phase * 2;

            Accumulator = std::fmodf(Accumulator, AccumulatorRange);
                
            channelData[sample] = (Accumulator / AccumulatorRange);
        }
        // ..do something to the data...
    }

Basically this code does make a saw wave but its measuring at very detuned G4 and im struggling to understand why

even if I remove the 360 and the * 2, even if I change 440, even if I use time instead of delta time even if I do accumulator = phase even if accumulator *= phase, accumulatorRange could be set to 2^8 or 2^16 (currently 2^16) and itll always be g4 and I dont know why

this method also has aliasing as well

9 Comments
2024/11/01
17:56 UTC

9

ELI5: PSD vs DFT (i.e. FFT)

I understand that the PSD and the FFT are similar mathematically but feature different amplitude scaling. What is the significance of this? What is the intuition behind wanting the PSD versus just calculating a simple FFT/amplitude?

22 Comments
2024/11/01
00:24 UTC

2

Software for batch sorting audio clips (by volume)

So I have 1000's of audio clips recorded with my Zoom. They were recorded using the auto-trigger mode that records when a certain DB threshold is crossed.

I need some way to sort the files as a lot of them are just noise or something quiet and not what I want to keep.

So most importantly I want to remove the quiet clips, if possible I would also like sort by DB and frequency so I only keep clips above a certain DB level but that level be under 400Hz or some other arbitrary frequency.

I have some coding experience but not with DSP, really just looking for a pre-existing program but would be willing to mess with something open source.

6 Comments
2024/10/31
21:28 UTC

19

[Project] AudioFlex: A Pure Python Library for Audio Stretching

If anyone’s like me and has a hard time making sense of C++ but still wants to explore audio stretching algorithms, I put together AudioFlex – a (much slower) pure Python implementation for a few of these methods. It’s definitely not optimized for speed but might help with understanding concepts like WSOLA and Overlap-Add in a more Pythonic way.

Code and examples are up on GitHub if you're interested: link

Would love any feedback or suggestions from the DSP community!

P.S. I would recommend AudioSmith's Talk on these stretching algorithms. It was a huge part of the project

0 Comments
2024/10/31
19:01 UTC

8

Career path with a Master in systems engineering for image and signal

Hello everybody,

First of all I'm from French Polynesia but studying in Europe in my last year of a Master degree in Systems engineering for signal and image, before that I've done a bachelor in Mathematics.

I would like to work in US after graduation but I'm a bit undecided about which field I could go in, one thing is sure is that I want to earn a good living (I mean who doesn't ?) so I would like to know which field is giving the best opportunities nowadays ? I'm open to all informations/experiences you have to share guys

Plus, I'm also seeking for an internship abroad, I saw that it could be a bit difficult to do it in US for international students, am I wright ? Once again, any info/experience could be very helpfull

Thank you for your reading

1 Comment
2024/10/31
12:46 UTC

6

Looking for a Mentor in Digital Signal Processing

Hi.

I recently finished a Digital signal processing course during my undergraduate studies. I studied DFT, DTFTs , Z-transforms and filter designs. To solidify my foundation, I am currently reading the book: "The Scientist and Engineer's Guide to Digital Signal Processing " by Steven W. Smith.

I am interested in pursuing this field even further by doing a masters in the field but I haven't really had the opportunity to do research/projects with regards to dsp because i took that course in my final year of school. From what I have discovered from applying to grad school, you should have the questions you want to answer in mind. Here is the case, I don't even know which of the subfield to go into.

I would really appreciate a mentor from industry or the research community.

Thank you in advance for all your insights.

0 Comments
2024/10/31
00:28 UTC

6

What is causing the phase shift in the output of the filter? I am simply passing a 500Hz sine wave through a an AWGN channel with variance of sqrt(0.5) and then filtering the noise using bandpass!

2 Comments
2024/10/30
18:41 UTC

2

Looking for Developer to create a Pitch Correction Project in C

I'm looking for a developer to work a tiny, short term project which is to create a pitch correction, aka Autotune project in C to work on mobile devices. The available algorithms to accomplish this should be basis.

Feel free to DM me if you are interested.

22 Comments
2024/10/30
17:11 UTC

4

How to start out with DSP algorithm development?

Hey guys, I've been interested in DSP for a pretty long time, since I was a kid I've wanted to work on stuff in this field. However, anything I am finding online requires knowledge of Calculus. Should I self study Calculus or wait to do dsp until I learn it in school next year? (I am in highschool). I currently only know precalculus since I'm a sophomore and I'm wondering if there's anything I can do on this front aside from just programming plugins until my mathematical knowledge is advanced. Also, any book reccs would be greatly appreciated.

14 Comments
2024/10/30
03:47 UTC

14

I don't understand the ROC

Let's say I have a simple signal/filter H(z) = 1 / (1 - z^(-1)). This means that the ROC is |z| > 1. So the ROC is outside the unit circle, meaning that the z-transform does not exist inside or on the unit circle. What does this mean??

It just seems so backwards and weird to me. Pretty much everything we do in the z-domain takes place inside the unit circle. Say I have a pole at z=1, but also a few zeros inside the unit circle. How does that work when the z-transform isn't even defined for any of those points?

See, I get it from a purely mathematical standpoint. 1 / (1 - az^(-1)) comes from the power series of (az^(-1))^(n), which only converges if |az^(-1)| < 1. The -1 power kinda makes it the opposite of the typical power series radius of convergence that I'm used to.

Still, it's kinda weird to me intuitively how it's the inside that doesn't converge. Especially when the border is at the unit circle. I mean, the inside is where everything takes place! That's where we do our work!

9 Comments
2024/10/29
23:05 UTC

5

High number of cascaded allpass filters: is there a more efficient formulation?

I have a series of allpass filters to create a chirp and/or wave dispersion sound effect.
Could something very similar (or even equivalent) be achieved using less computing power?
I've tried various nested structures in an exploratory way, but to no avail.
EDIT: the goal is to have a filter that can be placed / reused in other structures the same way it's possible with its current non-optimized form (i.e. it's not introducing resonant modes of its own, or any non-allpass characteristics).
Thanks!

5 Comments
2024/10/29
20:42 UTC

2

How does Time Synchronous Averaging result in this output SNR?

Hi I am just learning about time synchronous averaging and the math in my source goes as follows:

summation_{k runs from 1 to M} y_k(m) = summation_{k runs from 1 to M} x_k(m) + summation_{k runs from 1 to M} n_k(m), where y is the output, x is the input and n is the noise. k is the index of the signal realization and there is an ensemble of M signal realizations, with each having M time samples.

It says summation_{k runs from 1 to M} x_k(m) = M*x_K(m) and
summation_{k runs from 1 to M} n_k(m) => noise mean = 0 and noise variance = M*sigma^2. I understand it up to this point. But then it says that SNR_y = sqrt(M) * SNR_x; that time sync averaging improves the output SNR by a factor of root M. Can someone please explain to me how this is?

1 Comment
2024/10/29
17:30 UTC

Back To Top