Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

5
Help a newbie with some technical concepts?
Post Body

Hi, firstly I'd like to apologize for the long post.

I'm absolutely new to DSP. I've got some tangential knowledge from studying software engineering, but I've never dealt with DSP, nor most of the concepts that are used in the practice.

I've started doing some real-time DSP for fun, with the goal of creating digital guitar effects on my computer. I'm using Python with PyAudio (a wrapper for PortAudio), mainly because it's a language I'm very familiar with.

Firstly, I started capturing the Mic input and playing it back over the default output (my headphones). In the callback function, I receive a 1024 byte signal periodically, and get to modify it there.

Firstly, I created a memory, and set it up to record and reproduce a few seconds later, creating a delay effect that repeats everything it hears. Then, I created a simple function which multiplies the signal by a set value, making a gain effect. Both worked great.

But this is where my limited technical knowledge has driven me to a stall. I know that the audio from the input is sampled (my rate is 44100hz), which means reading the value that amount of times each second, and registering those values, mimicking the signal wave digitally. But I'm a bit confused as to what exactly is the data I'm dealing with. I wanted to create an overdrive effect, which would require me to clip the top of each wave (I'm sure there are more technical terms for that, I apologize), but I also wanted to create an EQ, which would require me to change the value of each frequency. But how to do both of these things with the data I have stumps me.

At first, I thought the 1024 byte array I had at any moment was the value for each frequency at that particular "snapshot" of the sampling. So, the first elements would be the low frequencies, and the last elements would be the high ones, and if I collected a few of these arrays, and looked at the same frequency for each, I would see a rough wave. But this is clearly wrong. I decided to visualize one of these arrays, which I had at a specific point in time, and I came up with this.

https://imgur.com/a/XtjellF

Clearly a wave. Which is very confusing, because firstly, I don't understand where is the information on the frequencies, and how I'd manipulate it. (I know it's just the frequency of oscillation of the wave, but that was ambient noise I recorded for that example, not a clear note, yet the sine wave is pretty clear). Secondly, I don't understand what amount of time that wave represents, because I have a new one an instant later. To test that that was really what I thought, I decided to apply the clipping I mentioned earlier to create an overdrive, resulting in a wave which looks like this:

https://imgur.com/a/fNGqgC5

and sure enough, it sounds overdriven, slightly distorted. So now I can create an overdrive effect, but I'm confused about how to deal with frequencies, and how to interpret the data I have.

Thank you for taking the time to read this, I appreciate any insight on the matter.

Author
Account Strength
100%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
30,604
Link Karma
7,785
Comment Karma
21,248
Profile updated: 4 days ago
Posts updated: 8 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
4 years ago