Capsim Block Documentation
Calculate impulse response from frequency response
Port | Type | Name | |
---|---|---|---|
0 | float | xfreq |
Port | Type | Name | |
---|---|---|---|
0 | float | ximp |
Num | Description | Type | Name | Default Value | |
---|---|---|---|---|---|
0 | Number of frequency points to input | int | nfft | 64 | |
1 | Conjugatate (0=No, 1=Yes) | int | conjFlag | 0 |
Num | Type | Name | Initial Value | Description |
---|---|---|---|---|
0 | float* | freqRes_A | ||
1 | float* | impRes_A | ||
2 | int | numSamples | ||
3 | float | conj |
int i; int j; |
---|
numSamples=0; /* * Allocate array for frequency response */ freqRes_A= (float *)malloc(nfft*sizeof(float)); if(freqRes_A==NULL) { fprintf(stderr,"Unable to allocate space in freqimp star \n"); return(1); } /* * Allocate array for impulse response */ impRes_A= (float *)malloc(2*nfft*sizeof(float)); if(impRes_A==NULL) { fprintf(stderr,"Unable to allocate space in freqimp star \n"); return(2); } if (conjFlag) conj= -1.0; else conj = 1.0; |
---|
for (j = MIN_AVAIL(); j > 0; --j) { /* * Get frequency response */ IT_IN(0); freqRes_A[numSamples]=xfreq(0); numSamples++; /* * Check if nfft samples read in */ if(numSamples == 2*nfft) { for(i=0; i |
---|
free(impRes_A); free(freqRes_A); |
---|
/* Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks) Copyright (C) 1989-2017 Silicon DSP Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA http://www.silicondsp.com Silicon DSP Corporation Las Vegas, Nevada */ |
---|
/* * |
---|