File: wigner.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
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);