N = 2;
R = 2;
B = 16;
M = 1;
FormatSpecR = '%f';
FormatSpecW = '%X\n';
%FormatSpecW = '%h\n';

MaxArg = 2^32;
Fc = 10;
Fs = 50;

Fnqst = (Fs/R)/2
Ftw = dec2hex(int32(MaxArg*(Fc/Fs)))


Bmax = ceil(log2(((R*M)^N)/R)+B);
MaxWidthR2 = ceil(log2(((2*M)^N)/2)+B);
MaxWidthR4 = ceil(log2(((4*M)^N)/4)+B);

ReadFilterCoefsId = fopen('C:\S5243_FFT_REPO\src\src\Sim\R2Test.fcf','r');
FilterCoefs = fscanf(ReadFilterCoefsId,FormatSpecR);
fclose(ReadFilterCoefsId);

CorrValue = 2^18;

CorrCoeffs = FilterCoefs*CorrValue;
CorrCoeffs = floor(CorrCoeffs);

WriteFilterCoefsId = fopen('C:\S5243_FFT_REPO\src\src\Sim\R2.txt','w');
fprintf(WriteFilterCoefsId,'%d\n', CorrCoeffs);
fclose(WriteFilterCoefsId);

s=25;
test = 0;

for c=1:s
    test = test+FilterCoefs(c);
end

