function FFT_header_gen(N)
% FFT_header_gen(N)
%
% Creates an FFT header file for an N-point FFT
% file name is FFT_header_N.h where N is the numerical value of N
% M=log2(N) which is the number of stages 
% N2 = N/2 which is the number of twiddle factors
% PI is the fixed-point approximation to pi

M=log2(N);
N2=N/2;

s=['FFT_header.h'];
fid = fopen(s,'w');		            % Open (or create) file

s=['// FFT_header.h\n'];
fprintf(fid,s);                     % Label file

s=['// This file must be included in FFT_func.c\n'];
fprintf(fid,s);                     % Label file

s=['// and by the program that calls FFT_func.c\n\n'];
fprintf(fid,s);                     % Label file

s=['#define N ' num2str(N) '                      // N-point FFT\n'];
fprintf(fid,s);                     % Define N
                                    % where N is the FFT order
s=['#define M ' num2str(M) '                        // M=log2(N)\n'];
fprintf(fid,s);                     % Define M                                   

s=['#define N2 ' num2str(N2) '                       // N/2 (number of twiddle factors)\n'];
fprintf(fid,s);                     % Define N2

s=['#define PI ' num2str(pi,'%11.15g') '        // fixed-point approx. to pi\n\n'];
fprintf(fid,s);                     % Define PI

s=['typedef struct {float real,imag;} COMPLEX;       // structure COMPLEX\n\n'];
fprintf(fid,s);                     % Define COMPLEX

fclose(fid);						% Close FFT_header.h
