# Source code for deltasigma._ds_synNTFobj1

# -*- coding: utf-8 -*-
# _ds_synNTFobj1.py
# Module providing the ds_synNTFobj1 function
# This file is part of python-deltasigma.
#
# python-deltasigma is a 1:1 Python replacement of Richard Schreier's
# MATLAB delta sigma toolbox (aka "delsigma"), upon which it is heavily based.
# The delta sigma toolbox is (c) 2009, Richard Schreier.
#
# python-deltasigma is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# LICENSE file for the licensing terms.

"""Module providing the ds_synNTFobj1() function
"""

import numpy as np

from ._db import db
from ._ds_f1f2 import ds_f1f2
from ._rmsGain import rmsGain
from ._utils import carray

[docs]def ds_synNTFobj1(x, p, osr, f0):
"""Objective function for :func:synthesizeNTF

This function is not meant to be used directly but it is provided for compliance with the
MATLAB DS Toolbox.

"""
p = carray(p)
z = np.exp(2j*np.pi*(f0 + 0.5/osr*x))
z = carray(z)
if f0 > 0: