# Zpg: Zero pole gain model In gsignal: Signal Processing

 Zpg R Documentation

## Zero pole gain model

### Description

Create an zero pole gain model of an ARMA filter, or convert other forms to a Zpg model.

### Usage

Zpg(z, p, g)

as.Zpg(x, ...)

## S3 method for class 'Arma'
as.Zpg(x, ...)

## S3 method for class 'Ma'
as.Zpg(x, ...)

## S3 method for class 'Sos'
as.Zpg(x, ...)

## S3 method for class 'Zpg'
as.Zpg(x, ...)

### Arguments

 z complex vector of the zeros of the model. p complex vector of the poles of the model. g overall gain of the model. x model to be converted. ... additional arguments (ignored).

### Details

as.Zpg converts from other forms, including Arma and Ma.

### Value

A list of class Zpg with the following list elements:

z

complex vector of the zeros of the model

p

complex vector of the poles of the model

g

gain of the model

### Author(s)

Tom Short, tshort@eprisolutions.com,
adapted by Geert van Boxtel, gjmvanboxtel@gmail.com.

### Examples

## design notch filter at pi/4 radians = 0.5/4 = 0.125 * fs
w = pi/4
# 2 poles, 2 zeros
# zeroes at r = 1
r <- 1
z1 <- r * exp(1i * w)
z2 <- r * exp(1i * -w)
# poles at r = 0.9
r = 0.9
p1 <- r * exp(1i * w)
p2 <- r * exp(1i * -w)

zpg <- Zpg(c(z1, z2), c(p1, p2), 1)
zplane(zpg)
freqz(zpg)

## Sharper edges: increase distance between zeros and poles
r = 0.8
p1 <- r * exp(1i * w)
p2 <- r * exp(1i * -w)
zpg <- Zpg(c(z1, z2), c(p1, p2), 1)
zplane(zpg)
freqz(zpg)

gsignal documentation built on May 15, 2022, 5:05 p.m.