Page 1 of 1

DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 9:45 am
by jay_dee
Hi,
I decided to look at the DSP components again. I tried these when they first came out but got pretty confused.
I down loaded the delay example and it does not want to run. am I correct in the assumption that lots have changed since I last tried the DSP components?
I can't find the initialise component etc.. are there any good examples for begineers? :)

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 10:10 am
by BenR
Hello,

I'm going through the wiki now and updating the examples to make them a bit more up to date and useful.

Here is the working delay example.
Delay.fcfx
(16.26 KiB) Downloaded 724 times
The data recorder window is great for visualising the DSP data and seeing what is happening in the chain.
DSP_Delay.jpg
DSP_Delay.jpg (44.96 KiB) Viewed 8198 times

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 10:33 am
by jay_dee
Cheers Ben,
I played about and made a simple Lo Pass Filter, works well in sim and monitoring through the data recorder.
Got my head around the basics of linking the DSP components. So far..it certainly seems a cleaner approach, without setting ticks etc.
DSP_Filter_1.fcfx
Filter
(13.59 KiB) Downloaded 697 times
When using the filter a coefficient is set to define the intensity of the filter. Can this be set progmatically?
there is not a option in the component so maybe using handles or somthing? :)
J.

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 11:19 am
by BenR
Hello,

Glad you're finding it easier and cleaner now.

I agree that adjustable coefficients would be useful. I can't see it being possible for the FIR and IIR filter but with the simpler ones it should be possible.

I'll get on it and see what I can do.

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 12:35 pm
by BenR
Ok should be there now :D

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 3:30 pm
by jay_dee
Hi, just tried sending to hardware.
Is this something silly my side or an effect of recent changes? :?

Code: Select all

I:\03 FLOWCODE\DSP Examples>C:\PROGRA~2\Flowcode\Common\COMPIL~1\picv2\batch\..\pic\bin\xc8.exe --chip=16F877A  "DSP_Filter_1.c" --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32 
C:\PROGRA~2\Flowcode\Common\COMPIL~1\picv2\pic\bin\picc --chip=16F877A DSP_Filter_1.c --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32
Microchip MPLAB XC8 C Compiler V2.10
Build date: Jul 30 2019
Part Support Version: 2.10
Copyright (C) 2019 Microchip Technology Inc.
DSP_Filter_1.c: FCD_0bc81_DSPFilter1__SetFilterCoefficient()
  1121:	FCV_0bc81_DSPFilter1__CV1 = FCL_VALUE;
	^ (192) undefined identifier "FCV_0bc81_DSPFilter1__CV1"
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

Re: DSP Components - Learning from scratch

Posted: Wed Mar 10, 2021 10:27 pm
by BenR
Hello,

Sorry that's my bug I'll get it sorted for you.

If you set the Variable Coefficients property to Yes then the error should go away.

Re: DSP Components - Learning from scratch

Posted: Thu Mar 11, 2021 4:27 pm
by jay_dee
Sorry Ben, tried the work around.
I get the same issue, irrespective of the variable coefficient setting.
J.

Re: DSP Components - Learning from scratch

Posted: Fri Mar 12, 2021 8:37 am
by jay_dee
Thanks Ben and FC Team,
Componenet compiling to hardware when 'Variable Coefficents' is set to No. This allow me to continue playing with the DSP filters. Thanks. J.

Re: DSP Components - Learning from scratch

Posted: Fri Mar 12, 2021 10:42 pm
by BenR
Thanks again,

Problem now found and fixed.