File: specfun.m

package info (click to toggle)
codec2 1.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 76,376 kB
  • sloc: ansic: 436,819; cpp: 2,091; objc: 1,736; sh: 1,510; python: 1,405; asm: 683; makefile: 605
file content (16 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function y = specfun(x,M,h)


fei = sin(pi*M*h)/M/sin(pi*h);
y=0;
for n =1 : M
    y = y +  1/M * (sinc( x - 0.5*( 2*n -1-M)*h)).^2;
    for m = 1:M
        alpha(n,m) = pi*h*( m+ n-1-M);
        B = (cos( 2*pi*x - alpha(n,m) ) - fei*cos( alpha(n,m)) )./( 1+ fei^2 - 2*fei*cos(2*pi*x));
        y = y + 2/M/M * (sinc( x - 0.5*( 2*n -1-M)*h)).*(sinc( x - 0.5*( 2*m -1-M)*h)).*B;
    end
end