Author Topic: DSP & general advice for guitar effects unit (with a twist)  (Read 9020 times)

0 Members and 1 Guest are viewing this topic.

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6719
  • Country: nl
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #25 on: September 24, 2016, 01:47:39 pm »
It's a DSP, but it's not a freely programmable DSP.

You'll very quickly run into a wall with how much you can do with it.
 

Offline pepelevampTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: nz
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #26 on: September 24, 2016, 01:54:12 pm »
I suspect there are efficient algorithms for sliding window auto-correlation (which is often the core of fundamental frequency estimation).
Yeah I have a browser full of it at the moment. They kinda all work on the idea of 'how similar am I to myself when shifted X samples left/right?' My gist of it is that if the signal is very similar to itself 1 second ago, its a 1hz signal. Etc.

At least the harmonics of a guitar are multiples of each other. I'll be doing some experiments tomorrow with low-brow zero-crossing stuff (thanks for reminding me about the sliding window). I just hope that the arduino can handle 3khz sampling on multiple analogue pins.

I plan on doing a high-cut filter by using:

lowfreq(t) = ( y(t-1)+y(t) ) / 2 ;  //half frequency by blurring with neighbour
smooth(t) = y(t) - lowfreq(t);     // only high frequency remains by subtracting low frequency component.

Hopefully this will mean that all my zero-crossing stuff will be high-frequency only. I also realized that I don't need to DC bias the signal - the Arduino merely treating negative volts as 0 will actually be okay. Because if I'm counting zero crossings, I can just count 0.001 crossings and have practically the same result. Will even be above the noise floor.
 

Offline pepelevampTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: nz
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #27 on: September 24, 2016, 01:56:10 pm »
It's a DSP, but it's not a freely programmable DSP.

You'll very quickly run into a wall with how much you can do with it.
I was under the impression it was fully programmable. I'll have another look at this IDE they offer.
 

Offline _Wim_

  • Super Contributor
  • ***
  • Posts: 1517
  • Country: be
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #28 on: September 24, 2016, 04:24:45 pm »
It's a DSP, but it's not a freely programmable DSP.

You'll very quickly run into a wall with how much you can do with it.
I was under the impression it was fully programmable. I'll have another look at this IDE they offer.

As far as I know, you need to use the provided building blocks. I do not remember there is a block in which you can freely program. They do have a FIR building block, which for filtering means you can do practically eveything, if you are able to generate the correct impulse. Of course using FIR is not ideal for low latency...

 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6719
  • Country: nl
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #29 on: September 24, 2016, 04:58:15 pm »
Yeah I have a browser full of it at the moment. They kinda all work on the idea of 'how similar am I to myself when shifted X samples left/right?' My gist of it is that if the signal is very similar to itself 1 second ago, its a 1hz signal. Etc.

That is the essence of auto-correlation, my point is that if you do autocorrelation say for the last 1024 samples there is probably some efficient incremental algorithm for if you take 992 of the old samples and 32 new ones (ie. a sliding window).
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2803
  • Country: nz
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #30 on: September 25, 2016, 10:42:31 pm »
I suspect there are efficient algorithms for sliding window auto-correlation (which is often the core of fundamental frequency estimation).
Yeah I have a browser full of it at the moment. They kinda all work on the idea of 'how similar am I to myself when shifted X samples left/right?' My gist of it is that if the signal is very similar to itself 1 second ago, its a 1hz signal. Etc.

At least the harmonics of a guitar are multiples of each other. I'll be doing some experiments tomorrow with low-brow zero-crossing stuff (thanks for reminding me about the sliding window). I just hope that the arduino can handle 3khz sampling on multiple analogue pins.

I plan on doing a high-cut filter by using:

lowfreq(t) = ( y(t-1)+y(t) ) / 2 ;  //half frequency by blurring with neighbour
smooth(t) = y(t) - lowfreq(t);     // only high frequency remains by subtracting low frequency component.

Hopefully this will mean that all my zero-crossing stuff will be high-frequency only. I also realized that I don't need to DC bias the signal - the Arduino merely treating negative volts as 0 will actually be okay. Because if I'm counting zero crossings, I can just count 0.001 crossings and have practically the same result. Will even be above the noise floor.

Averaging two samples gives a low pass filter, with a cutoff of 1/2 the sample rate. If you have correctly filtered the input to not include any frequencies over half the sample rate, as they will alias back down and confuse things.

Also the way you are processing will cause phase shift as the subtraction isn't symmetrical.

Maybe try

lowfreq(t-1) = ( y(t-2)+y(t-1)+y(t) ) / 3
highfreq(t-1) = y(t-1)- lowfreq(t-1);

which is a (shabby) high pass at 1/3rd the sample rate. At a rough approximation that should leave all frequencies between 0.33 and 0.66 of the sample rate relatively untouched (and those greater than 0.5 shouldn't be there in the first place).

Also, be weary that some filters look to have no gain, but because of ripple and phase delays you can end up with positive gain under some unlikely inputs - so allow yourself a little headroom.

Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 

Offline pepelevampTopic starter

  • Regular Contributor
  • *
  • Posts: 101
  • Country: nz
Re: DSP & general advice for guitar effects unit (with a twist)
« Reply #31 on: September 26, 2016, 07:54:17 am »


Averaging two samples gives a low pass filter, with a cutoff of 1/2 the sample rate. If you have correctly filtered the input to not include any frequencies over half the sample rate, as they will alias back down and confuse things.

Also the way you are processing will cause phase shift as the subtraction isn't symmetrical.
......

Also, be weary that some filters look to have no gain, but because of ripple and phase delays you can end up with positive gain under some unlikely inputs - so allow yourself a little headroom.

Thanks man that is very helpful. I hadn't realized that it was asymmetrical. This directly affects my primary calculations, so it was a great thing to point out. Big thanks. Aspromised, a picture of my cat:
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf