ΣSigmaStudio Ask AI Русский Log in

SigmaStudio code programming.

SigmaDSP & SigmaStudio leonxp Apr 1, 2013 00:00 3 replies Original on forum ↗
Subscribe
leonxp Question
Apr 1, 2013 00:00

Hi everybody, I'd like to know if SigmaStudio allows a small code programming solution. For example, I'd need to write Filter Funcionality of a Warped FIR filter, an iterative procedure of sums and products between samples of previous time. This costs one program code line in Matlab for instance. I'm looking for a code-programming way (for Mathematical procedure) to program the chip, if it is feasible.
Thanks to all.

Regards,

leonxp

KJBob Reply
Apr 7, 2013 00:00

Hi leonxp,

I'm afraid that the short answer is no, there isn't a C compiler or Matlab-like script for SigmaDSP. It is possible, however, to implement a warped FIR filter by building a structure like that of a FIR filter, substituting all-pass filters for the usual unit delays:

As you know, although the structure looks like FIR, the all-pass filters impart an infinite impulse response.

The ADAU1701 can fit about 80 of these stages. For the example below I set the first coefficient to +1, the last to -1, and all others to zero, to make a comb filter. In the usual FIR version using delays, the nulls repeat at equal Hz intervals. The warped version's nulls get wider apart with increasing frequency, as shown:

The attached project file includes this filter with the frequency sweeper that made the graph.

Best regards,

Bob

1c7b705e98da0d65be792c61d22d225a.jpg
1c7b705e98da0d65be792c61d22d225a.jpg
1c7b705e98da0d65be792c61d22d225a.jpg-408x301.jpg
1c7b705e98da0d65be792c61d22d225a.jpg-408x301.jpg
c4fc012e5019d7ef8f246b28debc618e.jpg
c4fc012e5019d7ef8f246b28debc618e.jpg
c4fc012e5019d7ef8f246b28debc618e.jpg-450x272.jpg
c4fc012e5019d7ef8f246b28debc618e.jpg-450x272.jpg
leonxp Reply
Apr 9, 2013 00:00

Thanks Bob, you rock. Now I tried to implement IIR filter of 4th order in a graphical way and I recieved a compiling error about "Illegal feedback loop". What is this i wonder.

Thanks guys.

Regards,

leonxp

7a79be499d9f7aefa329605de5203579.bmp
7a79be499d9f7aefa329605de5203579.bmp
KJBob Reply
Apr 10, 2013 00:00

Hi lenoxp,

Use a feedback cell (under Basic DSP / DSP Functions) as shown below to eliminate the "illegal feedback" error. This instructs the SigmaDSP compiler to bring that signal backwards in your flow. The fed-back quantity re-enters the flow on the next sample's calculations -- in other words, the feedback cell has a built-in unit delay. Thus it substitutes for one of the delays in your filter.

BTW, this is a neat filter! What sort of response does it have?

Bob

5cc3ad90ff083cd9ef68747f315629fc.jpg
5cc3ad90ff083cd9ef68747f315629fc.jpg
5cc3ad90ff083cd9ef68747f315629fc.jpg-482x290.jpg
5cc3ad90ff083cd9ef68747f315629fc.jpg-482x290.jpg