| Prev | Next | hilbert |
| Syntax |
y = hilbert(Ntaps) ("RECTANGULAR" assumed) |
| Syntax |
y = hilbert(Ntaps,wintype) (all windows except "GAUSSIAN" and "KAISER") |
| Syntax |
y = hilbert(Ntaps,wintype,winparam) ("GAUSSIAN" and "KAISER" windows only) |
| Include: |
include spt\hibert.oms |
| See Also | linfir , pwlfir , rcfir , srrcfir , pbfir |
ARGUMENTS:
INPUTS:
Ntaps = INPUT, scalar, any numerical type. Filter length in
[taps]. Coerced to INTEGER.
wintype = INPUT, string. One of ["RECTANGULAR"|
"TRIANGULAR"|"HAMMING"|"HANNING"|"NUTTALL"|
"BLACKMAN"|"GAUSSIAN"|"KAISER"].
winparam = INPUT, scalar, any numerical type. Parameter
used by GAUSSIAN or KAISER window functions.
Coerced to DOUBLE.
RETURN: Returns DOUBLE column vector Hilbert Transformer FIR
filter of length Ntaps.
Designs and returns a Hilbert transformer FIR digital filter as a column vector.
Creates a linear phase, windowed Hilbert Transformer FIR
filter of length 'Ntaps'. Function returns a column vector of
type DOUBLE. 'Ntaps' may be of any numerical type and is
coerced to INTEGER before local processing. 'Ntaps' must be
ODD-valued, and must be >=3 or novalue is returned.
The ideal Hilbert transformer is a filter with unity gain and
a phase shift of 90 degrees at all frequencies. The Hilbert
transform is useful in creating 'analytic' signals and
generally where quadrature related signals are required. The
Hilbert transform of a sinewave is another sinewave delayed
by 90 degrees. The Hilbert transformer FIR has an additional
delay of (Ntaps-1)/2 samples due to the causality of the filter.
A window function may be applied to the resulting FIR filter.
'wintype' is a string specifying the window type to be
applied. 'winparam' is the numerical parameter used with the
GAUSSIAN and KAISER window functions. If you leave off
'wintype' and 'winparam', a "RECTANGULAR" window is assumed.
For windows other than "GAUSSIAN" and "KAISER", 'winparam'
may be omitted. Error handling is done by 'winddata()' function.
Ntaps = 31 # Number of taps
win = "TRIANGULAR"; # Window Type
fs = 10d3 # sampling rate
h = hilbert(Ntaps,win) # HAMMING
h
t = seq(Ntaps)-1d0; # Tap index
M = 100; # Number points for freq response
fmin = 10d0; # freq min plot
fmax = fs/2-1d0; # freq max plot
df = (fmax-fmin)/M; # freq increment
f = (seq(M+1)-1d0)/M*fs/2d0; # freq vector
HdB = db20(gainz(h,1,f,fs)); # dB response
The filter taps are:
{
-0.00297465
0
-0.0102969
0
-0.0202817
0
-0.0347042
0
-0.0573682
0
-0.0981634
0
-0.193352
0
-0.669296
0
0.669296
0
0.193352
0
0.0981634
0
0.0573682
0
0.0347042
0
0.0202817
0
0.0102969
0
0.00297465
}
Plots of the filter and it's frequency response are:
Reference
Stearns & David