function p=epdpss(m,x)
% P=EPDPSS(M,X) calculates a matrix P which contains
% spectral distribution over time-and frequency using 
% (time-varying) evolutionary periodogram. M is 
% the number of expansion functions, N is the number of 
% time samples.Uses Prolate Spheroidal.
%  A.S. Kayhan, Nov. 11, 2007. 
[n1,n] = size(x);
if (n1 > 1),
x = x.';
n=n1;
end

f=(dpss(n,m/2))';

for i=1:m,
	c=f(i,:).*x;
	b(i,:)=fft(c,n);
end
for i=1:n,
	a=zeros(1,n);
	for j=1:m,
		a=a+conj(f(j,i)).*b(j,:);
	end
	for k=1:n/2,
	p(i,k)=(abs(a(k)))^2;
	end
end
%v=[45 45];
mesh(p)
return
end
