/*
* Copyright (C) 2005-2007 by Pieter Palmers
*
* This file is part of FFADO
* FFADO = Free Firewire (pro-)audio drivers for linux
*
* FFADO is based upon FreeBoB.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#include "DelayLockedLoop.h"
namespace Util {
/**
* Creates a new Delay Locked Loop with a predefined order and
* a predefined set of coefficients.
*
* Make sure coeffs is a float array containing order+1 coefficients.
*
* @pre order > 0
* @param order order of the DLL
* @param coeffs coefficients to use
*/
DelayLockedLoop::DelayLockedLoop(unsigned int order, float *coeffs)
{
unsigned int i;
m_order=order;
if (m_order==0) m_order=1;
m_coeffs=new float[order];
m_nodes=new float[order];
for (i=0;i 0
* @param order order of the DLL
*/
DelayLockedLoop::DelayLockedLoop(unsigned int order)
{
unsigned int i;
m_order=order;
if (m_order==0) m_order=1;
m_coeffs=new float[order];
m_nodes=new float[order];
for (i=0;i 0
* @param order new order for the DLL
* @param coeffs coefficients to use
*/
void
DelayLockedLoop::setOrder(unsigned int order, float* coeffs) {
unsigned int i;
reset();
m_order=order;
if (m_order==0) m_order=1;
if(m_coeffs) delete[] m_coeffs;
m_coeffs=new float[order];
if(m_nodes) delete[] m_nodes;
m_nodes=new float[order];
for (i=0;i 0
* @param order new order for the DLL
*/
void
DelayLockedLoop::setOrder(unsigned int order) {
unsigned int i;
reset();
m_order=order;
if (m_order==0) m_order=1;
if(m_coeffs) delete[] m_coeffs;
m_coeffs=new float[order];
if(m_nodes) delete[] m_nodes;
m_nodes=new float[order];
for (i=0;i