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.
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.
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:
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.
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/DSP/comment...