Learn R Programming

emuR (version 2.5.0)

crplot: Function to plot a digital sinusoid and the circle from which it is derived.

Description

A digital sinusoid is derived the movement of a point around a circle. The function shows the relationship between the two for various parameter settings.

Usage

crplot(
  A = 1,
  k = 1,
  p = 0,
  N = 16,
  const = NULL,
  figsize = 8,
  npoints = 500,
  col = 1,
  cplot = TRUE,
  splot = TRUE,
  numplot = TRUE,
  axes = TRUE,
  incircle = TRUE,
  arrow = TRUE,
  linetype = 1,
  textplot = NULL,
  lineplot = NULL,
  ylab = "Amplitude",
  super = NULL,
  xaxlab = NULL,
  type = "b",
  xlab = "Time (number of points)",
  fconst = 3.5/3.1,
  pointconst = 1.2
)

Arguments

A

Amplitude of the circle/sinusoid.

k

Frequency of the sinusoid

p

Phase of the sinusoid

N

Number of points per cycle or revolution.

const

A constant corresponding to k + A*cos(2*pi*k+p)

figsize

Set the figure size as pin <- c(figsize, figsize/2). Defaults to figsize = 8.

npoints

The number of points used in plotting the circle. Defaults to 500

col

An integer for the color in plotting the sinusoid and points around the circle

cplot

Now redundant

splot

Now redundant

numplot

Logical. If TRUE (defaults), the digital points around the circle are numbered

axes

Logical. If TRUE, plot axes.

incircle

Logical. If TRUE, plot an the angle between digital points in the circle.

arrow

Logical. If TRUE, plot an arrow on incircle showing the direction of movement.

linetype

Specify a linetype. Same function as lty in plot

textplot

A list containing $radius, $textin, $pivals for plotting text at specified angles and radii on the circle. $radius: a vector of amplitudes of the radii at which the text is to be plotted; $textin: a vector of character labels to be plotted; $pivals: the angle, in radians relative to zero radians (top of the circle) at which the text is to be plotted. Defaults to NULL

lineplot

Plot lines from the centre of the circle to the circumference. lineplot is a vector specifying the angle in radians (zero corresponds to the top of the circle)

ylab

Specify a y-axis label.

super

Superimpose a part solid circle and corresponding sinusoid. This needs to be a list containing $first and $last, which are values between 0 and 2*pi defining the beginning and ending of the part circle which is to be superimposed

xaxlab

Now redundant

type

Specify a type.

xlab

Specify an x-axis label.

fconst

A single element numeric vector for the aspect ratio in a postscript plot. Defaults to 3.5/3.1 which is appropriate for a postscript setting of setps(h=4, w=4)

pointconst

The radius for plotting the numbers around the circle. Defaults to 1.2 * A

Author

Jonathan Harrington

References

Harrington, J, & Cassidy, S. 1999. Techniques in Speech Acoustics. Kluwer

See Also

cr

Examples

Run this code

crplot()
# sine wave
crplot(p=-pi/2)

crplot(k=3)

# aliasing
crplot(k=15)

Run the code above in your browser using DataLab