Learn R Programming

seewave (version 1.6.4)

ccoh: Continuous coherence function between two time waves

Description

This function returns a two-dimension coherence representation between two time waves. The function corresponds to a sliding coherence function along the two signals. This produces a 2-D density plot. An amplitude contour plot can be overlaid.

Usage

ccoh(wave1, wave2, f, wl = 512, ovlp = 0, plot = TRUE,
grid = TRUE, scale = TRUE, cont = FALSE,
collevels = seq(0, 1, 0.01), palette = rev.heat.colors,
contlevels = seq(0, 1, 0.01), colcont = "black",
colbg="white", colgrid = "black",
colaxis = "black", collab="black",
xlab = "Time (s)", ylab = "Frequency (kHz)",
scalelab = "Coherence",
main = NULL,
scalefontlab = 1, scalecexlab =0.75, axisX = TRUE, axisY = TRUE,
flim = NULL, flimd = NULL,
...)

Arguments

Value

  • This function returns a list of three items:
  • timea numeric vector corresponding to the time axis.
  • freqa numeric vector corresponding to the frequency axis.
  • ampa numeric matrix corresponding to the coherence. Each column corresponds to a coherence function of length wl.

Details

Coherence is a frequency domain function computed to show the degree of a relationship between two signals. The value of the coherence function ranges between zero and one, where a value of zero indicates there is no causal relationship between the signals. A value of one indicates the existence of linear frequency response between the two signals. This can be used, for instance, to compare the input and output signals of a system. Any colour palette can be used. In particular, it is possible to use other palettes coming with seewave: temp.colors, rev.gray.colors.1, rev.gray.colors.2, spectro.colors, rev.terrain.colors, rev.topo.colors, rev.cm.colors corresponding to the reverse of terrain.colors, topo.colors, cm.colors. Use locator to identify points.

See Also

coh, spectro, spec.pgram.

Examples

Run this code
wave1<-synth(d=1,f=4000,cf=500)
wave2<-synth(d=1,f=4000,cf=800)
ccoh(wave1,wave2,f=4000)

Run the code above in your browser using DataLab