Error using MathEx Class

Yes sir! :wink:

Sorry that sounded negative. It just gets frustrating when you have to spend your time correcting the implementation to be testable instead of creating and testing new code.

InterruptPort is an excellent example of a class that is very difficult to create a testable interface around as it is sealed. So you have to create an interface around InterruptPort , create a new testable InterruptPort port class, inherit InputPort, and hope you implement the InterruptPort class correctly.


public interface IInterruptPort : IInputPort
    {
        Port.InterruptMode Interrupt { get; set; }
    }

//Ugh, InterruptPort is sealed :(
    public class InterruptPortT : InputPort, IInterruptPort
    {

        public InterruptPortT(Cpu.Pin portId, bool glitchFilter, Port.ResistorMode resistor, Port.InterruptMode interrupt) :
            base(portId, glitchFilter, resistor)
        {
            this.Interrupt = interrupt;
        }

        public static IInterruptPort CreateInstance(Cpu.Pin portId, bool glitchFilter, Port.ResistorMode resistor, Port.InterruptMode interrupt)
        {
            return new InterruptPortT(portId, glitchFilter, resistor, interrupt);
        }
            

        #region IInteruptPort Members
        //TODO: Is there any logic that needs to be here?
        public Microsoft.SPOT.Hardware.Port.InterruptMode Interrupt
        {
            get;
            set;
        }

        #endregion
        
    }


Creating tests or simulations around the inputs and outputs is a very important yet time intensive task with the current design.

Reference gus on FFT in native code

There are quite a few examples of DFT and FFT already written in C. Granted they are overflowing with divsion and multiplication, but with your inbuilt math routines and these readly availabe routines, can you not use theseā€¦

I personally have no need for these routines but Iā€™m a great believer of not re-inventing the wheelā€¦

cheers Ian

I finished the FFT code and tested it.
I test two MF devices.

  1. Panda(72MHz)
    .NET MF 4.1, VS2010
    Test data:1024 points.
    Math: Elze Koolā€™s Math
    2.Imote2(104 Mhz)
    .NET MF 2.0, VS2005
    Math: Elze Koolā€™s Math
    Test data:1024 points.
    Results:
    For Panda:
    It takes near 3 seconds.
    For Imote2:
    It takes near 0.2 seconds.

Can you try this again but using the GHI math library?

I change to GHI math library.
Its also the same, near 3 seconds.
I change to chipworkX, Its take near 0.8 S.
Why the performance of chipworkX(200Mhz) is lower than Imote2(104Mhz).

does imote2 run NETMF4.1?

does the processor have floating point in hardware?

its run .Net MF2.0
VS2005.

  1. one runs 2.0 and the other 4.1ā€¦years apart so we are comparing apples to oranges here
  2. The board uses xscale processor which can do more that ARM9 ARM architecture family - Wikipedia

So,do you have plan to put the FFT in native code?

That is a possibility but for me to convince GHI of adding it, I need an example application where FFT is done in C# and speed is required for that application so moving FFT to native side is needed.

Basically, a proposal from you to GHI that I will help in passing on. I assume you have FFT experience and you will help in defining what functionality will be added, if GHI decides to do it. Even help in the FFT implementation if need. I am not sure if we have someone with strong FFT experience so we may need help, from you and others.

Thank you, Gus:
After I finished my project, I will post it on the MF project website.

If we could use RLP on the USBizi, it would be a lot easier to add high performance native code for custom use cases. =(
Now the only way would be modifying the firmware of the Panda/Dominoā€¦

RLP = losing resources from the system even if you are not using RLP. Since most users do not use RLP and resources are precious on these little systems, RLP on USBizi is not favorable to most usersā€¦it would have been sweet feature though :slight_smile:

How much resources we are loosing? Why not providing two versions of the firmware? One with RLP, one without?

Why all this extra work, on customers and on GHI? If you need something natively and you are serious about it for commercial use then just contact GHI directly with your needs. If you are just having fun then this would be an overkill.