Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Fixed point IFFT

Subject: Fixed point IFFT

From: Anthony

Date: 28 Aug, 2007 21:08:47

Message: 1 of 2

I am trying to send fixed point data to the IFFT module. It
only accepts double or single data types and reports an
error: "Undefined function or method 'ifft' for input
arguments of type 'embedded.fi'" I don't understand this
because the numerictype I created specifies that my
DataType = double, and DataTypeMode = Scaled double: binary
point scaling. So is there a way to change the embedded.fi
to double? I have also tried Datatype = fixed, and
DataTypeMode = Fixed-point: binary point scaling.

Subject: Fixed point IFFT

From: Tom Bryan

Date: 29 Aug, 2007 11:54:17

Message: 2 of 2

Anthony wrote:
> I am trying to send fixed point data to the IFFT module. It
> only accepts double or single data types and reports an
> error: "Undefined function or method 'ifft' for input
> arguments of type 'embedded.fi'" I don't understand this
> because the numerictype I created specifies that my
> DataType = double, and DataTypeMode = Scaled double: binary
> point scaling. So is there a way to change the embedded.fi
> to double? I have also tried Datatype = fixed, and
> DataTypeMode = Fixed-point: binary point scaling.

You have a couple of choices:
(1) Cast the fi object to double, then call ifft. For example:

     x = fi(1:16);
     y = ifft(double(x));

(2) Write an m-file implementation of ifft that accepts a fi for input.
  There are fft examples using fi in the Fixed-Point Toolbox demo
directory. A new feature is that the m-files can be compiled so that
they are very fast (see help on emlmex). To see the fft examples, do

     demos % at the MATLAB command line
     Navigate to
     Toolboxes > Fixed-Point > Fixed-Point Fast Fourier Transform (FFT)

There is also a demo of compiling the m-code in Fixed-Point Toolbox demo

     Fixed-Point Lowpass Filtering Using Embedded MATLAB MEX

And there are other examples of fixed-point fft implementations in
directory <matlabroot>/toolbox/fixedpoint/fidemos. To see them, in the
MATLAB command window do

     cd([matlabroot,'/toolbox/fixedpoint/fidemos'])
     ls *fft*.m

fi_fft_demo_plot.m fi_m_radix2fft_skip_w0.m
fi_m_radix2fft_algorithm1_6_2.m fi_m_radix2fft_withscaling.m
fi_m_radix2fft_blockfloatingpoint.m fi_radix2fft_demo.m

     ls *fft*.c

fi_c_radix2fft_blockfloatingpoint.c fi_c_radix2fft_withscaling.c
fi_c_radix2fft_skip_w0.c

Best wishes,
Tom Bryan

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us