Mercurial > hg > octave-terminal
changeset 9072:bd8e388043c4
Cleanup documentation for signal.texi, image.texi, audio.texi
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Wed, 01 Apr 2009 17:06:45 -0700 |
parents | 034800482c79 |
children | 17ce09c3d030 |
files | doc/interpreter/audio.txi doc/interpreter/image.txi doc/interpreter/signal.txi scripts/image/image_viewer.m scripts/image/imread.m scripts/signal/arma_rnd.m scripts/signal/stft.m src/DLD-FUNCTIONS/fft.cc src/DLD-FUNCTIONS/fft2.cc src/DLD-FUNCTIONS/fftn.cc src/DLD-FUNCTIONS/fftw.cc |
diffstat | 11 files changed, 56 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/audio.txi +++ b/doc/interpreter/audio.txi @@ -25,8 +25,8 @@ `sample' is a single output value from an A/D converter, i.e., a small integer number (usually 8 or 16 bits), and audio data is just a series of such samples. It can be characterized by three parameters: the -sampling rate (measured in samples per second or Hz, e.g. 8000 or -44100), the number of bits per sample (e.g. 8 or 16), and the number of +sampling rate (measured in samples per second or Hz, e.g., 8000 or +44100), the number of bits per sample (e.g., 8 or 16), and the number of channels (1 for mono, 2 for stereo, etc.). There are many different formats for representing such data. Currently,
--- a/doc/interpreter/image.txi +++ b/doc/interpreter/image.txi @@ -20,15 +20,17 @@ @chapter Image Processing Since an image basically is a matrix Octave is a very powerful -environment for processing and analysing images. To illustrate +environment for processing and analyzing images. To illustrate how easy it is to do image processing in Octave, the following example will load an image, smooth it by a 5-by-5 averaging filter, and compute the gradient of the smoothed image. @example +@group I = imread ("myimage.jpg"); S = conv2 (I, ones (5, 5) / 25, "same"); [Dx, Dy] = gradient (S); +@end group @end example @noindent @@ -47,17 +49,19 @@ @section Loading and Saving Images The first step in most image processing tasks is to load an image -into Octave. This is done using the @code{imread} function, which uses the -@code{GraphicsMagick} library for reading. This means a vast number of image +into Octave. This is done using the @code{imread} function, which uses the +@code{GraphicsMagick} library for reading. This means a vast number of image formats is supported. The @code{imwrite} function is the corresponding function for writing images to the disk. In summary, most image processing code will follow the structure of this code @example +@group I = imread ("my_input_image.img"); J = process_my_image (I); imwrite ("my_output_image.img", J); +@end group @end example @DOCSTRING(imread) @@ -67,7 +71,7 @@ @DOCSTRING(IMAGE_PATH) It is possible to get information about an image file on disk, without actually -reading in into Octave. This is done using the @code{imfinfo} function which +reading it into Octave. This is done using the @code{imfinfo} function which provides read access to many of the parameters stored in the header of the image file. @@ -78,10 +82,10 @@ A natural part of image processing is visualization of an image. The most basic function for this is the @code{imshow} function that -shows the image given in the first input argument. This function uses -an external program to show the image. If gnuplot 4.2 or later is +shows the image given in the first input argument. This function uses +an external program to show the image. If gnuplot 4.2 or later is available it will be used to display the image, otherwise the -@code{display}, @code{xv}, or @code{xloadimage} program is used. The +@code{display}, @code{xv}, or @code{xloadimage} program is used. The actual program can be selected with the @code{image_viewer} function. @DOCSTRING(imshow) @@ -96,15 +100,15 @@ @section Representing Images In general Octave supports four different kinds of images, gray-scale -images, RGB images, binary images, and indexed images. A gray-scale +images, RGB images, binary images, and indexed images. A gray-scale image is represented with an M-by-N matrix in which each -element corresponds to the intensity of a pixel. An RGB image is +element corresponds to the intensity of a pixel. An RGB image is represented with an M-by-N-by-3 array where each 3-vector corresponds to the red, green, and blue intensities of each pixel. The actual meaning of the value of a pixel in a gray-scale or RGB -image depends on the class of the matrix. If the matrix is of class +image depends on the class of the matrix. If the matrix is of class @code{double} pixel intensities are between 0 and 1, if it is of class @code{uint8} intensities are between 0 and 255, and if it is of class @code{uint16} intensities are between 0 and 65535. @@ -114,9 +118,9 @@ if it is @code{true}. An indexed image consists of an M-by-N matrix of integers -and a C-by-3 color map. Each integer corresponds to an +and a C-by-3 color map. Each integer corresponds to an index in the color map, and each row in the color map corresponds to -an RGB color. The color map must be of class @code{double} with values +an RGB color. The color map must be of class @code{double} with values between 0 and 1. @DOCSTRING(gray2ind) @@ -167,8 +171,8 @@ @DOCSTRING(contrast) -An additional colormap is @code{gmap40}. This code map contains only -colors with integer values of the red, green and blue components. This +An additional colormap is @code{gmap40}. This code map contains only +colors with integer values of the red, green and blue components. This is a workaround for a limitation of gnuplot 4.0, that does not allow the color of line or patch objects to be set, and so @code{gmap40} is useful for gnuplot 4.0 users, and in particular in conjunction with the @var{bar}, @@ -185,25 +189,27 @@ @section Plotting on top of Images If gnuplot is being used to display images it is possible to plot on -top of images. Since an image is a matrix it is indexed by row and -column values. The plotting system is, however, based on the -traditional @math{(x, y)} system. To minimize the difference between +top of images. Since an image is a matrix it is indexed by row and +column values. The plotting system is, however, based on the +traditional @math{(x, y)} system. To minimize the difference between the two systems Octave places the origin of the coordinate system in -the point corresponding to the pixel at @math{(1, 1)}. So, to plot +the point corresponding to the pixel at @math{(1, 1)}. So, to plot points given by row and column values on top of an image, one should simply call @code{plot} with the column values as the first argument -and the row values as the second. As an example the following code +and the row values as the second. As an example the following code generates an image with random intensities between 0 and 1, and shows the image with red circles over pixels with an intensity above @math{0.99}. @example +@group I = rand (100, 100); [row, col] = find (I > 0.99); hold ("on"); imshow (I); plot (col, row, "ro"); hold ("off"); +@end group @end example @node Color Conversion
--- a/doc/interpreter/signal.txi +++ b/doc/interpreter/signal.txi @@ -21,9 +21,9 @@ @chapter Signal Processing -This chapter describes the signal processing and fast fourier -transform functions available in Octave. Fast fourier transforms are -computed with the @sc{fftw} or @sc{Fftpack} libraries depending on how +This chapter describes the signal processing and fast Fourier +transform functions available in Octave. Fast Fourier transforms are +computed with the @sc{fftw} or @sc{fftpack} libraries depending on how Octave is built. @@ -32,15 +32,15 @@ @DOCSTRING(fft) -Octave uses the FFTW libraries to perform FFT computations. When Octave -starts up and initializes the FFTW libraries, they read a system wide +Octave uses the @sc{fftw} libraries to perform FFT computations. When Octave +starts up and initializes the @sc{fftw} libraries, they read a system wide file (on a Unix system, it is typically @file{/etc/fftw/wisdom}) that contains information useful to speed up FFT computations. This information is called the @emph{wisdom}. The system-wide file allows -wisdom to be shared between all applications using the FFTW libraries. +wisdom to be shared between all applications using the @sc{fftw} libraries. Use the @code{fftw} function to generate and save wisdom. Using the -utilities provided together with the FFTW libraries +utilities provided together with the @sc{fftw} libraries (@command{fftw-wisdom} on Unix systems), you can even add wisdom generated by Octave to the system-wide wisdom file.
--- a/scripts/image/image_viewer.m +++ b/scripts/image/image_viewer.m @@ -22,11 +22,11 @@ ## previous values. ## ## When the @code{image} or @code{imshow} function is called it will -## launch an external program to display the image. The default behaviour +## launch an external program to display the image. The default behavior ## is to use gnuplot if the installed version supports image viewing, ## and otherwise try the programs @code{display}, @code{xv}, and ## @code{xloadimage}. Using this function it is possible to change that -## behaviour. +## behavior. ## ## When called with one input argument images will be displayed by saving ## the image to a file and the system command @var{command} will be called
--- a/scripts/image/imread.m +++ b/scripts/image/imread.m @@ -25,12 +25,12 @@ ## Read images from various file formats. ## ## The size and numeric class of the output depends on the -## format of the image. A colour image is returned as an +## format of the image. A color image is returned as an ## MxNx3 matrix. Grey-level and black-and-white images are ## of size MxN. -## The colour depth of the image determines the numeric +## The color depth of the image determines the numeric ## class of the output: "uint8" or "uint16" for grey -## and colour, and "logical" for black and white. +## and color, and "logical" for black and white. ## ## @seealso{imwrite, imfinfo} ## @end deftypefn
--- a/scripts/signal/arma_rnd.m +++ b/scripts/signal/arma_rnd.m @@ -30,7 +30,7 @@ ## ## @noindent ## in which @var{k} is the length of vector @var{a}, @var{l} is the -## length of vector @var{b} and @var{e} is gaussian white noise with +## length of vector @var{b} and @var{e} is Gaussian white noise with ## variance @var{v}. The function returns a vector of length @var{t}. ## ## The optional parameter @var{n} gives the number of dummy
--- a/scripts/signal/stft.m +++ b/scripts/signal/stft.m @@ -19,7 +19,7 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {[@var{y}, @var{c}] =} stft (@var{x}, @var{win_size}, @var{inc}, @var{num_coef}, @var{w_type}) -## Compute the short-term Fourier transform of the vector @var{x} with +## Compute the short-time Fourier transform of the vector @var{x} with ## @var{num_coef} coefficients by applying a window of @var{win_size} data ## points and an increment of @var{inc} points. ## @@ -52,7 +52,7 @@ ## @end deftypefn ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at> -## Description: Short-term Fourier transform +## Description: Short-Time Fourier Transform function [Y, c] = stft(X, win, inc, coef, w_type)
--- a/src/DLD-FUNCTIONS/fft.cc +++ b/src/DLD-FUNCTIONS/fft.cc @@ -34,9 +34,9 @@ #include "utils.h" #if defined (HAVE_FFTW3) -#define FFTSRC "@sc{Fftw}" +#define FFTSRC "@sc{fftw}" #else -#define FFTSRC "@sc{Fftpack}" +#define FFTSRC "@sc{fftpack}" #endif static octave_value
--- a/src/DLD-FUNCTIONS/fft2.cc +++ b/src/DLD-FUNCTIONS/fft2.cc @@ -37,9 +37,9 @@ // This function should be merged with Fifft. #if defined (HAVE_FFTW3) -#define FFTSRC "@sc{Fftw}" +#define FFTSRC "@sc{fftw}" #else -#define FFTSRC "@sc{Fftpack}" +#define FFTSRC "@sc{fftpack}" #endif static octave_value @@ -173,7 +173,7 @@ @deftypefn {Loadable Function} {} fft2 (@var{a}, @var{n}, @var{m})\n\ Compute the two-dimensional FFT of @var{a} using subroutines from\n" FFTSRC -". The optional arguments @var{n} and @var{m} may be used specify the\n\ +". The optional arguments @var{n} and @var{m} may be used specify the\n\ number of rows and columns of @var{a} to use. If either of these is\n\ larger than the size of @var{a}, @var{a} is resized and padded with\n\ zeros.\n\ @@ -192,7 +192,7 @@ @deftypefn {Loadable Function} {} fft2 (@var{a}, @var{n}, @var{m})\n\ Compute the inverse two-dimensional FFT of @var{a} using subroutines from\n" FFTSRC -". The optional arguments @var{n} and @var{m} may be used specify the\n\ +". The optional arguments @var{n} and @var{m} may be used specify the\n\ number of rows and columns of @var{a} to use. If either of these is\n\ larger than the size of @var{a}, @var{a} is resized and padded with\n\ zeros.\n\
--- a/src/DLD-FUNCTIONS/fftn.cc +++ b/src/DLD-FUNCTIONS/fftn.cc @@ -35,9 +35,9 @@ // This function should be merged with Fifft. #if defined (HAVE_FFTW3) -#define FFTSRC "@sc{Fftw}" +#define FFTSRC "@sc{fftw}" #else -#define FFTSRC "@sc{Fftpack}" +#define FFTSRC "@sc{fftpack}" #endif static octave_value @@ -154,7 +154,7 @@ @deftypefn {Loadable Function} {} fftn (@var{a}, @var{size})\n\ Compute the N-dimensional FFT of @var{a} using subroutines from\n" FFTSRC -". The optional vector argument @var{size} may be used specify the\n\ +". The optional vector argument @var{size} may be used specify the\n\ dimensions of the array to be used. If an element of @var{size} is\n\ smaller than the corresponding dimension, then the dimension is\n\ truncated prior to performing the FFT. Otherwise if an element\n\ @@ -171,7 +171,7 @@ @deftypefn {Loadable Function} {} ifftn (@var{a}, @var{size})\n\ Compute the inverse N-dimensional FFT of @var{a} using subroutines from\n" FFTSRC -". The optional vector argument @var{size} may be used specify the\n\ +". The optional vector argument @var{size} may be used specify the\n\ dimensions of the array to be used. If an element of @var{size} is\n\ smaller than the corresponding dimension, then the dimension is\n\ truncated prior to performing the inverse FFT. Otherwise if an element\n\
--- a/src/DLD-FUNCTIONS/fftw.cc +++ b/src/DLD-FUNCTIONS/fftw.cc @@ -40,9 +40,9 @@ @deftypefnx {Loadable Function} {@var{wisdom} =} fftw ('dwisdom')\n\ @deftypefnx {Loadable Function} {@var{wisdom} =} fftw ('dwisdom', @var{wisdom})\n\ \n\ -Manage FFTW wisdom data. Wisdom data can be used to significantly\n\ +Manage @sc{fftw} wisdom data. Wisdom data can be used to significantly\n\ accelerate the calculation of the FFTs but implies an initial cost\n\ -in its calculation. When the FFTW libraries are initialized, they read\n\ +in its calculation. When the @sc{fftw} libraries are initialized, they read\n\ a system wide wisdom file (typically in @file{/etc/fftw/wisdom}), allowing wisdom\n\ to be shared between applications other than Octave. Alternatively, the\n\ @code{fftw} function can be used to import wisdom. For example\n\ @@ -62,7 +62,7 @@ \n\ If @var{wisdom} is an empty matrix, then the wisdom used is cleared.\n\ \n\ -During the calculation of fourier transforms further wisdom is generated.\n\ +During the calculation of Fourier transforms further wisdom is generated.\n\ The fashion in which this wisdom is generated is equally controlled by\n\ the @code{fftw} function. There are five different manners in which the\n\ wisdom can be treated, these being\n\ @@ -73,7 +73,7 @@ calculating a particular is performed, and a simple heuristic is used\n\ to pick a (probably sub-optimal) plan. The advantage of this method is\n\ that there is little or no overhead in the generation of the plan, which\n\ -is appropriate for a fourier transform that will be calculated once.\n\ +is appropriate for a Fourier transform that will be calculated once.\n\ \n\ @item 'measure'\n\ In this case a range of algorithms to perform the transform is considered\n\