pvsbandp
Prev | Orchestra Opcodes and Operators | Next

## pvsbandp

pvsbandp — A band pass filter working in the spectral domain.

## Description

Filter the pvoc frames, passing bins whose frequency is within a band, and with linear interpolation for transitional bands.

## Syntax

    fsig pvsbandp fsigin, xlowcut, xlowfull, \
          xhighfull, xhighcut[, ktype]

## Performance

fsig -- output pv stream

fsigin -- input pv stream.

xlowcut, xlowfull, xhighfull, xhighcut -- define a trapezium shape for the band that is passed. The a-rate versions only apply to the sliding case.

ktype -- specifies the shape of the transitional band. If at the default value of zero the shape is as below, with linear transition in amplitude. Other values yield and exponential shape:

(1 - exp( r*type )) / (1 - exp(type))

This includes a linear dB shape when ktype is log(10) or about 2.30.

The opcode performs a band-pass filter with a spectral envelope shaped like

klowfull __________________________ khighfull
/ \
/ \
/ \
/ \
/ \
________/ \______________
klowcut khighcut

## Examples

Here is an example of the pvsbandp opcode. It uses the file pvsbandp.csd.

Example 806. Example of the pvsbandp opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <CsoundSynthesizer>
     <CsOptions>
     ; Select audio/midi flags here according to platform
     ; Audio out   Audio in
     -odac    ;;;RT audio I/O
     ; For Non-realtime ouput leave only the line below:
     ; -o pvsbandp.wav -W ;;; for file output any platform
     </CsOptions>
     <CsInstruments>

     sr = 44100
     ksmps = 32
     nchnls = 2
     0dbfs = 1

     ;; example written by joachim heintz 2009

     instr 1
     Sfile = "fox.wav"
     klowcut = 100
     klowfull = p4
     khighfull = p5
     khighcut = 2000
     ain    soundin	Sfile
     fftin  pvsanal	ain, 1024, 256, 1024, 1; fft-analysis of the audio-signal
     fftbp  pvsbandp	fftin, klowcut, klowfull, khighfull, khighcut ; band pass
     abp    pvsynth	fftbp; resynthesis
     	outs    abp, abp
     endin

     </CsInstruments>
     <CsScore>
     ;         lowfull highfull
     i 1 0 3     200     1900
     i 1 + 3     100     1500
     e
     </CsScore>
     </CsoundSynthesizer>

## See Also

pvsanal, pvsynth, pvsadsyn, pvsbandr

## Credits

Author: John ffitch
December 2007

Prev | Up | Next
pvsarp | Home | pvsbandr