File: wigner.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (37 lines) | stat: -rw-r--r-- 795 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function tab=wigner(x,h,deltat,zp)
//macro which computes the 'time-frequency' wigner
//spectrum of a signal.
//
//	tab    : wigner spectrum (lines correspond to the time variable)
//	x      : analysed signal
//	h      : data window
//      deltat : analysis time increment (in samples)
//      zp     : length of FFT's. %pi/zp gives the frequency increment.
//!
//
//   Initializations
//
// Copyright INRIA
l=prod(size(x));
n=prod(size(h));
npr=2*n;
h=h.*conj(h);tab=[];
//
//   Analytical signal computation using Hilbert transform
//
[y,y1]=convol(hilb(127),x);
z=x+%i*y;
//
//   Wigner distribution computation
//
t=n;
while t<=l-n,
  z1=h.*z(t:t+n-1).*conj(z(t:-1:t-n+1));
  z1(zp)=0;
  w=fft(z1,-1);
  w=2*(2*real(w)-z(t)*z(t)'*ones(w));tab=[tab;w];
  t=t+deltat;
end;
tab=tab(:,1:zp);