function output=edge_enhance(input,cutoff,f_amp,b_amp)
%This function applies the edge enhance filter using FIR filtering.
%-----------------------------------------------------------------
%Output - Output image
%Input - Input image
%cutoff - Normalised cutoff frequency
%f_amp - Foreground amplification
%b_amp - Background amplification

input=double(input);
b = fir1(2,cutoff); %Generate 1D FIR filter with N=3
h = ftrans2(b);     %and convert it to 2D

low=filter2(h,input); %Filter to obtain low freq components


high=input-low;  %Sepearate high freq components
high_amp=high*f_amp;  %Amplify
low_amp=low*b_amp;    %Amplify
output=high_amp+low_amp;    %Sum and output
output=uint8(output);