This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R: 8192 POINT FFT calculation issue

Part Number: MSP432P401R
Other Parts Discussed in Thread: MSP432E401Y

Hi everybody,
I need your help in order to solve a problem.

I want to read 3 axis accelerometer (analog sensor)  data  in 10khz bandwidth and I need to calculate 8192 point FFT for  every one minute sensor data captured.

How can I compute 8192 point FFT in MSP432P4 along with CMSIS-DSP library?

Is it possible to calculate 8192 point FFT in MSP432P4 controller with available RAM space?

I analyzed the examples and everyone is calculating up to 4096  FFT points. Is there any restrictions for calculating  FFT points more than 4096 points in MSP432P4 controller along with CMSIS-DSP library?

Can you suggest any microcontroller which I should use instead of MSP432P4 for the above purpose?

  • Hi,

    I take a look into the CMSIS-DSP library and finds out it is made by third party. And the complex FFT only support up to 4096 points. Reference in TI Resource Explorer.

    I do not know what is the limitation of performing a 8192 FFT. I am sorry that I can't help you more. 

    Best regards,

    Cash Hao

  • Hi Cash Hao

    Thanks for your  response.

    I would like to ask one point , whether CMSIS-DSP library is not supporting the calculation of 8192 FFT points or RAM size is creating issue with 8192 points?

    If  I am using my own library for calculating the FFT whether MSP432P4 controller will work for 8192 point FFT with available RAM space?

    I analyzed some forums and they are telling it is due to less RAM size in the microcontroller.

    Any other methods or library for calculating the 8192 points FFT along with MSP432P4 or latest MSP432 controller?

    Thanks in advance

    Raina

  • Hi Raina,

    I do not know why the CMSIS-DSP library is not supporting 8192 FFT.

    However, if you think it is the RAM size issue, you can try MSP432E401Y with 256kB RAM compared to the MSP432P401R with 64kB RAM.

    Best regards,

    Cash Hao

  • A long time ago I downloaded a Pascal module named U_FTG2.pas. I still use it.

    It was written all the way back in 1996!

    It handles complex FFT of ANY number of samples including prime (prime = very slow!).

    The code itself is about 100 lines.

    8192 points should at 32 bit resolution (single precission floating point) use around 200 kB of RAM.

    Maybe it could be modified to be used in your code?

    The trickcy part is to find it these days. So I took the liberty to post the entire code below.

    UNIT U_FTG2;                           {Last mod by JFH on 03/18/96}
    
    (* *****************************************************************************
    
     UNIT FOR PERFORMING GLASSMAN FFT AND INVERSE
    
     Note that with the Glassman FFT, the number of points does not have to be a
         power of 2.  Instead, the transform will take advantage of any factoring
         that can be done on the number of points.  Which means that if the number
         of points is prime, the transform will not be "fast" at all.
    
     Rev. 08/30/00 by JFH for Delphi-5 by going to dynamic arrays required no
         change other than the removal of tComplexArray.  Also fixed error in
         CAScale and removed unused variables in GFTInnerLoop.
     Rev. 03/18/96 by JFH for Delphi-2 by removing def of "PI" and going
         to open arrays.
     Pgm. 03/27/89 by J F Herbster
    
    ***************************************************************************** *)
    
    INTERFACE
    
    TYPE
      tComplex = record r,i: single end;
      tFactorArray = array [1..32] of integer;
    
    Procedure CxAdd (var sum: tComplex; a,b: tComplex);
    
    Procedure CxMpy (var prd: tComplex; a,b: tComplex);
    
    Procedure CAScale
       (const Inp: array of tComplex; var aOut: array of tComplex;
        A: single; N: integer);
    
    Procedure GetFactors
        (n: integer; var factors: tFactorArray; var nf: integer);
    
    Procedure CFTG
       (const Cinp: array of tComplex; var Cout, CScr: array of tComplex;
        NC: integer);
    { returns a complex Fourier transform of the Cinp array into the Cout array.
      The CScr (scratch) array may be same as the input array. The transform will
      be from the time to the frequency domain if NC is positive of the number
      of complex points to be converted or from the frequency to the time domain
      if NC is the negative of the number of complex points.  The only difference
      between the two is just a divide by the number of points. }
    
    IMPLEMENTATION {===============================================================}
    
    Procedure CxAdd (var sum: tComplex; a,b: tComplex);
        begin sum.r:=a.r+b.r; sum.i:=a.i+b.i end;
    
    Procedure CxMpy (var prd: tComplex; a,b: tComplex);
        begin prd.r:=a.r*b.r-a.i*b.i; prd.i:=a.i*b.r+a.r*b.i end;
    
    Procedure CAScale
       (const Inp: array of tComplex; var aOut: array of tComplex;
        A: single; N: integer);
    Var i: word;
    Begin
      For i := N-1 {JFH, 08/30/00} downto 0 do
           begin aOut[i].r:=A*Inp[i].r; aOut[i].i:=A*Inp[i].i; end;
    End;
    
    Procedure GetFactors(n: integer; var factors: tFactorArray; var nf: integer);
    { Factor n into its nf primes in array factors[]. }
      Var nr,tf,q: word;
    Begin
      nr:=n; q:=nr; tf:=2; nf:=1;
      While tf<q do begin
          q:=nr div tf;
          if q*tf=nr
            then begin factors[nf]:=tf; Inc(nf); nr:=q end
            else Inc(tf);
        end{while};
        factors[nf]:=nr;
      End;
    
    Procedure GFTInnerLoop
       (const Inp: array of tComplex; var aOut: array of tComplex;
        NC: integer; X, S: integer);
    Var WDL1,WD,CTemp,CTemp2: tComplex;  N,L1,L,K,D,I,U,H: word; a: single;
    Begin
      N:=abs(NC); D:=N div S; I:=0;
      a:=(-(2*Pi)*D)/NC; WD.r:=cos(a); WD.i:=sin(a);
      For L1:=1 to S do
        begin
          If L1=1
            then begin WDL1.r := 1.0; WDL1.i := 0.0 end
            else CxMpy(WDL1,WDL1,WD);
          For L:=1 to D do
            begin
              K:= (L+(L1-1)*D*X) mod N;
              U:=K+(X-1)*D;
              CTemp:=Inp[U-1];
              For H:=2 to X do
                begin
                  CxMpy (CTemp,CTemp,WDL1);
                  U:=U-D; CTemp2:=Inp[U-1];
                  CxAdd (CTemp,CTemp,CTemp2);
                end;
              aOut[i]:=CTemp;
              Inc(I);
            end{L-loop};
        end{L1-loop};
    End;
    
    Procedure CFTG
       (const Cinp: array of tComplex; var Cout, CScr: array of tComplex;
        NC: integer);
    { CScr array may be same as the Cinp array.}
    Var  a: single; j,n,x,s,nf: integer; r: tFactorArray;
    Begin
    
    { Let n be the number of complex elements in the array.}
      n:=abs(NC);
      If n=0
        then exit;
    
      GetFactors(n,r,nf);          { Factor n into its primes.}
    
    { Now do the transformation.}
      s:=1;
      For j:=1 to nf do
        begin
          x:=r[j]; s:=s*x;
          If j=1
            then GFTInnerLoop (CInp, COut, NC, X, S)
            else if Odd(j)
              then GFTInnerLoop (CScr, COut, NC, X, S)
              else GFTInnerLoop (COut, CScr, NC, X, S);
        end{j-loop};
    
    { Finally, check for the required scaling and that data is in out array.}
      If nc < 0 then a:=1.0 else a:=1.0/n;
      If not Odd(nf)
        then CAScale({in}CScr, {out}COut, a, N)
        else if a<>1
          then CAScale(COut, COut, a, N);
    
    End;
    
    END.
    
    

  • Hi Cash Hao

    Thanks for your  response.

    I will try with MSP432E401Y microcontroller and will let you know the results.

    Thanks & Regards

    Raina

  • Hi Ja Hv

    Thanks for your  response.

    This is a new information for me and surely will try use of this method.

    Thanks & Regards

    Raina

  • Hi Cash Hao,

    I would like to ask one more point related with DMA in MSP432E4xx 

     I am trying to read analog sensor values using ADC and using DMA am transferring values from ADC to SRAM buffer using ping pong mechanism.

    Is there any sample codes available with respect to reading 3 analog channels and  DMA  transfer using ping pong buffer mechanism in MSP432E4xx?

    Thanks & Regards

    Raina

  • Hi Raina,

    You can find some resource here. TI Resource Explore->SimpleLink MSP432E4 SDK->Examples->Development Tools->DriverLib

    I am not sure if it has the exact example what you need. You can check it out.

    Best regards,

    Cash Hao