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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
*
* This help file was generated from periodogram.sci using help_from_sci().
*
-->
<refentry version="5.0-subset Scilab" xml:id="periodogram" xml:lang="en"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:ns3="http://www.w3.org/1999/xhtml"
xmlns:mml="http://www.w3.org/1998/Math/MathML"
xmlns:scilab="http://www.scilab.org"
xmlns:db="http://docbook.org/ns/docbook">
<refnamediv>
<refname>periodogram</refname>
<refpurpose>Return the periodogram (Power Spectral Density) of X</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Calling Sequence</title>
<synopsis>
[PXX, W] = periodogram (X, WIN, NFFT, FS)
[PXX, W] = periodogram (..., "RANGE")
</synopsis>
</refsynopsisdiv>
<refsection>
<title>Parameters</title>
<variablelist>
<varlistentry><term>X:</term>
<listitem><para>data vector. If X is real-valued a one-sided spectrum is estimated. If X is complex-valued, or "RANGE" specifies "twosided", the full spectrum is estimated.</para></listitem></varlistentry>
<varlistentry><term>WIN:</term>
<listitem><para> window weight data. If window is empty or unspecified a default rectangular window is used. Otherwise, the window is applied to the signal ('X .* WIN') before computing th periodogram. The window data must be a vector of the same length as X.</para></listitem></varlistentry>
<varlistentry><term>NFFT:</term>
<listitem><para>number of frequency bins. The default is 256 or the next higher power of 2 greater than the length of X ('max (256,2.^nextpow2 (length (x)))'). If NFFT is greater than the length of the input then X will be zero-padded to the length of NFFT.</para></listitem></varlistentry>
<varlistentry><term>FS:</term>
<listitem><para>sampling rate. The default is 1.</para></listitem></varlistentry>
<varlistentry><term>RANGE:</term>
<listitem><para>range of spectrum. "onesided" computes spectrum from [0..nfft/2+1]."twosided" computes spectrum from [0..nfft-1].</para></listitem></varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Description</title>
<para>
The optional second output W are the normalized angular frequencies. For a one-sided calculation W is in the range [0, pi]. If NFFT is even and [0, pi) if NFFT is odd. Similarly, for a two-sided calculation W is in the range [0, 2*pi] or [0, 2*pi)depending on NFFT.
</para>
<para>
If a sampling frequency is specified, FS, then the output frequencies F will be in the range [0, FS/2] or [0, FS/2) for one-sided calculations. For two-sided calculations the range will be [0, FS).
</para>
</refsection>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
n=0:319;
x=cos(%pi/4*n)+rand(size(n,"r"),"normal");
[pxx,w]=periodogram(x,ones(1,320),256,2000,"onesided");
plot2d(w,10*log10(pxx))
xtitle('periodogram','frequency','magnitude(db)')
xgrid()
]]></programlisting>
<scilab:image>
n=0:319;
x=cos(%pi/4*n)+rand(size(n,"r"),"normal");
[pxx,w]=periodogram(x,ones(1,320),256,2000,"onesided");
plot2d(w,10*log10(pxx))
xtitle('periodogram','frequency','magnitude(db)')
xgrid()
</scilab:image>
</refsection>
</refentry>
|