function [Yanal,freqout]=Chan_anal(Xanal,Hanal,freq1,freq2)
%This function produces the analytic equivalent filtered response
%Xanal is the analytic representation of the signal to be filtered
%Hanal is the analytic representation of the channel
%freq1 are the frequencies over which Xanal is defined
%freq2 are the frequencies over which Hanal is defined


freqout=intersect(freq1,freq2);
size(Xanal);
size(Hanal);
fmax=max(freqout);
fmin=min(freqout);
index1=find(freq1>=fmin & freq1<=fmax);
index2=find(freq2>=fmin & freq2<=fmax);
size(index1);
size(index2);
Yanal=.5*Hanal(index2).*Xanal(index1);
