DSP Device for Guitar Pedal Effect - Page 4

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

I read some articles about that. It does make me wonder whether you
could rewrite the non-linear functions in a way so the harmonics are
not created in the first place. This should be more efficient than
upsampling -> non-linear function -> filtering -> downsampling.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: DSP Device for Guitar Pedal Effect




Nico Coesel wrote:

Quoted text here. Click to load it


It could be done if you can approximate the input by an analytical
function. Or approximate the nonlinearity by Volterra Series. Both ways
require pretty involved math; brute force oversampling is usually
simpler and cheaper.

Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com

Re: DSP Device for Guitar Pedal Effect


Quoted text here. Click to load it

I think I'll flesh out the code in C, apply it to some PCM files, then
analyze the results first.

Do you think the harmonics from the non-linear function on a digital
sample would show up in the processed PCM file or would it have to be
converted to analog then analyzed?

The compression itself is going to add harmonics, so how would I be
able to separate the ones generated by the compression from the ones
generated by applying the non-linear function to a digital signal and
the conversion processes?

Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

It will also be visible in the digital domain. Cooledit is a very good
tool for this sort of work.

Quoted text here. Click to load it

Try different input frequencies. At frequencies closer to Fmax you'll
see more aliasing.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: DSP Device for Guitar Pedal Effect




Fred wrote:

Quoted text here. Click to load it


This makes perfect sense. Before doing anything with a DSP, get the
stuff to work on PC with a sound card.

Quoted text here. Click to load it

Aliasing is a natural phenomenon. You will see it in digital as well as
in analog.

Quoted text here. Click to load it

Harmonics are the multiples of the fundamental frequency; aliases are
generally not.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com

Re: DSP Device for Guitar Pedal Effect


I have begun to doubt that the Spin chip will be able to handle all
the cordic code in a timely manner.

So as I look/wait for affordable hardware that can do this I might as
well get started on the coding.

This project  has already been on hold for years due to a lack of
affordable hardware, at least they're getting closer.

Re: DSP Device for Guitar Pedal Effect


Quoted text here. Click to load it

So, use a lookup table. Cordic is iterative and the more accuracy you
want, the more iterations you need.

It's much faster to use a lookup table, a single line of C or assembler
in the best case:

u16Sine = u16SineTable [u16Angle];

Ok, you need a few more to resolve over the full range for cos, but it's
still lightspeed in comparison to cordic or other analytical methods,

Why do some people insist on doing things the hard way ? :-)...

Regards,

Chris


Re: DSP Device for Guitar Pedal Effect


Quoted text here. Click to load it

Presumably by "a few more" you mean lines of code to implement stuff
like cos x = sin(x+pi/2), sin(pi-x) = sin x, sin x = -sin(x+pi), and
so forth.  Thus one can use one quarter-cycle table for both sin and
cos.  Also it is straightforward to use a one-term Taylor series so
that a much-smaller table suffices.  sin(x+h) ~ sin x + h*cos x and
cos(x+h) ~ cos x - h*sin x with accuracy improving quadratically as
table size increases.  With n = 64, 128, 256 and 512 and |h| less
than pi/(2n) the maximum relative error and maximum absolute error
at angles (k*pi)/2^16 for any integer k are like in following table.

  n  Max rel err  Max abs err
  64   0.000502   0.000301
 128   0.000125   0.000075
 256   0.000031   0.000019
 512   0.000008   0.000005

Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

That's neat. My math is old and I haven't needed extreme accuracy in the
past, but that one goes in the methods logbook to look into further !. I
use sin tables for embedded graphics work primarily. Things like object
rotation, which needs a new x,y screen address calculated for every
pixel within the object. It's very compute intensive and unusably slow
using standard library calls. Table methods can allow the use of a much
lower performance cpu while still getting adequate performance. Modern
micros often have hundred's of k of flash code space, so it makes sense
to do the math offline, rather than at runtime. For a 16 bit table, the
entries are calculated and scaled so that sin (90) is close to 65535 to
maximise accuracy, then scale the range of the system data to suit.

The 'added lines' for cos were just to handle the fact that with a one
quadrant table, you need to start reading back from the end of the table
for cosine, rather than from the start in the sin case. For graphics,
you often need to work in all 4 quadrants, but that can be handled by
inversion and reflection on a single quadrant table...

Regards,

Chris

Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

CORDIC is an acronym, it means COordinate Rotation by Digital
Integrating Computer.  It was chosen for implementing the
transcendental functions on the 8087, 80287 and 80387 for because it
was less computational effort for equivalent results.  It is actually
worthy of study in its own right.

Re: DSP Device for Guitar Pedal Effect


Quoted text here. Click to load it

I read about that.  Seems easy enough.  I have to work out how many
iterations would be required, how many instruction cycles each
iteration would entail, and balance that with the controllers speed
and sampling rate.  Again easy enough.

First I have to re-verse myself with coding.  It's been 5-6 years
since I did anything in C, and even then it was only some basic
numerical routines, Fibonacci stuff.  And for assembler, that was only
one class in college, uh, twenty five years ago.  :)

That all should keep me from getting bored for a while...

Oh by the way, could you give me an overview of how a logic array
could be programed to do this?

Re: DSP Device for Guitar Pedal Effect


On Mon, 9 Nov 2009 09:35:45 -0800 (PST), Fred

Quoted text here. Click to load it

I was figuring on just storing the amplitude conversion data in EPROM.
As in a simple state machine.

Implementing the serious math in an FPGA can be faster but seriously
more difficult (expensive, i could have to go outside for that).

Re: DSP Device for Guitar Pedal Effect


On Wed, 28 Oct 2009 21:39:43 -0500, Vladimir Vassilevsky

Quoted text here. Click to load it

It helps the analog filters a bit.  Do the oversampling digitally.

Re: DSP Device for Guitar Pedal Effect


On Wed, 28 Oct 2009 08:58:15 -0500, "Jon Slaughter"

Quoted text here. Click to load it
Not necessarily, there are three octaves between 12 kHz and 96 kHz.  A
mere 2nd order filter will give 24 dB attenuation, and a "better" 4th
order filter will provide an easy 48 dB (if the electronics is that
good).20%

Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

Not really. Sharp filters usually need a high Q which means you'll
lose resolution if you're not carefull. Sharp digital filters do have
their pitfalls. Besides, it is easier to make a sharp filter close to
half the sampling frequency (i.e. max bandwith) than half way the
sampling frequency because you can have the zeroes closer together.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: DSP Device for Guitar Pedal Effect


Quoted text here. Click to load it

Um... really. Look it up. Read up on oversampling and you might learn
something.

http://en.wikipedia.org/wiki/Oversampling


There are three main reasons for performing oversampling:

  a.. It aids in anti-aliasing because realisable analog anti-aliasing
filters are very difficult to implement with the sharp cutoff necessary to
maximize use of the available bandwidth without exceeding the Nyquist limit.
By increasing the bandwidth of the sampled signal, the anti-aliasing filter
has less complexity and can be made less expensively by relaxing the
requirements of the filter at the cost of a faster sampler. Once sampled,
the signal can be digitally filtered and downsampled to the desired sampling
frequency. In modern integrated circuit technology, digital filters are much
easier to implement than comparable analog filters of high order.
  b.. In practice, oversampling is implemented in order to achieve cheaper
higher-resolution A/D and D/A conversion. For instance, to implement a
24-bit converter, it is sufficient to use a 20-bit converter that can run at
256 times the target sampling rate. Averaging a group of 256 consecutive
20-bit samples adds 4 bits to the resolution of the average, producing a
single sample with 24-bit resolution.
Which obviously completely contradicts what you have said. Of course I
imagine your just another person who believes facts just get in the way?


Re: DSP Device for Guitar Pedal Effect


The development boards are $125, although the SDK only runs on XP.   I
kicked M$ to the curb years ago.  I have to talk with Spin's tech
support about making it WINE compatible.

It's been quite a while since I did any coding, and even then it was
only a some numerical routines for crypto stuff on the Digital Mars C
compiler.  So, any coding now is going to be like the first time...

I did start off with IBM 360/370 BAL in college.  Gee, that was al the
way back in the eighties.  I used to dream in assembler back then.  :)

Anyway, I'll have to work out which will be the most direct
prototyping a VST plugin or going right to the development board.

My views on sample rate is that ten time over the highest frequency is
good.   That would make mean 200kHz for audio work.  I have a
mechanical engineer buddy that has done stress analysis on stuctures
with DAQs and pressure sensors.  According to him to get good enough
samples for analysis you have to ten times over.

In my SPICE work, I found for FFT audio plots you have to go ten time
over to get smooth plots.  In guitar effects that use low sampling
rates, 44.1kHz and lower, I can hear the difference in sound quiality
from the ones that use 96kHz processing, like The TC Electronics
effects and the Rocktron Voodu Valve and Expression units.  Their
effects especially the delays and compression have a sweet liquid
smoothness to them that is just superior.

Cheers,

Fred

Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

That is another problem. If you look at dots you can't see the signal.
If you use a signal reconstruction algorithm like Cooledit does, you
can see the original signal. The word see is very important here; the
brain is the problem, not the sampling frequency. If you play the
signal back through a D/A converter you'll also get the original
signal back (assuming the original signal's bandwidth doesn't exceed
the A/D and D/A converter's bandwidth).

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: DSP Device for Guitar Pedal Effect



Quoted text here. Click to load it

Thats first grade theory (note the word 'theory').

Quoted text here. Click to load it

I wouldn't say easier. I'd say a digital filter is more predictable
but has other isssues to deal with.

Quoted text here. Click to load it

That isn't right. IIRC a while ago someone here explained you you'll
get two extra bits. Not 4. Besides that, if you have a perfect DC
level between two bit values at the input of your 20 bit converter
you'll never get a reading that has a >20 bits accuracy. Oversampling
only works well for delta-sigma converters because they have
(basically) an error feedback.

Quoted text here. Click to load it

Nope. Experience speaking here. I bet you never actually built
something with an ADC that has to maintain full bit resolution through
numerous digital filter / signal processing stages.

--
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
We've slightly trimmed the long signature. Click to see the full one.
Re: DSP Device for Guitar Pedal Effect


On Tue, 27 Oct 2009 19:42:12 -0500, "Jon Slaughter"

Quoted text here. Click to load it
On the other side of the coin 1MS/s 16 (REAL) bits is VERY expensive.
Whereas 20 bits (real resolution) at 96 kHz is affordable.

Site Timeline