blob: f7cc457943c6bdd3ee6d7cac6c6759ba8e994806 (
plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
function bw= enbw (window, fs)
// This function estimate Equivalent noise bandwidth.
// Calling Sequence
// bw=enbw(window)
// bw=enbw(window, fs)
//
// Parameters
// window: specify the sample window.
// fs: specify the sampling rate of window.
// bw: returns the two-sided equivalent noise bandwidth for a uniformly sampled window
// Examples
// window=1:10
//fs=2.5
//bw=enbw(window, fs)
// See also
// Authors
// Jitendra Singh
if isreal(window) then
else
error ('Input arguments window should be real.')
end
if isvector(window) then
else
error ('Input arguments window should be a vector.')
end
if or(type(window)==10) then
error ('Input arguments must be double.')
end
if type (window)~=1 then
error ('Expected input number 1, WINDOW, to be one of these types: double, single..Isntead its type was char.' )
end
rms_win= sqrt(mean(window.*window));
bw = (rms_win/mean(window))^2;
if argn(2) > 1
if fs<=0 then
error ('Expected input number 2, Fs, to be positive.')
end
bw = bw * (fs) / length(window);
end
endfunction
|