Changeset 17
- Timestamp:
- 10/30/2008 08:28:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/source/motif/cbutil.c
r16 r17 1937 1937 float frq; /* frequency of signal in Hz */ 1938 1938 float tffac; /* transfer function factor */ 1939 float tffac2; /* second factor of this kind */ 1939 1940 char lfilname[BC_LINELTH+1]; /* local filter name */ 1940 1941 TIME ttime; /* trace time */ … … 1957 1958 frq = 1/period; 1958 1959 1960 /* if a filter is applied the comment info entry contains its name */ 1959 1961 locstat = BC_NOERROR; 1960 1962 db_gets( trcptr, ES_COMMENT, BC_LINELTH, str, &locstat ); 1961 1963 if (locstat == BC_NOERROR) { 1964 /* we have to look for a substring starting with 'FLT:' */ 1962 1965 filptr = strstr( str, "FLT:" ); 1963 1966 if (filptr == NULL) filptr = strstr( str, "flt:" ); … … 1968 1971 } /*endif*/ 1969 1972 } else { 1973 /* if no filter found in the comment string it is an unfiltered trace */ 1970 1974 *filter = '\0'; 1971 1975 } /*endif*/ 1972 1976 strcpy( lfilname, filter ); 1973 1977 1978 /* if it is an unfiltered trace, take the transfer function of the recording 1979 * instrument. This is returned by cu_lookup_filter. */ 1974 1980 if (*lfilname == '\0') { 1975 1981 locstat = cBcNoError; … … 1982 1988 } /*endif*/ 1983 1989 1984 /* build filter name & read amplitude */ 1990 /* if the trace is unfiltered or filtered with an simulation filter, the 1991 * transfer function is found by applying a prefix 'TF_VEL_' or 'TF_DSP_'. 1992 * Then this this contains the complete information needed here. 1993 * Build filter name & read amplitude */ 1985 1994 strcpy( str, "TF_" ); 1986 1995 strcat( str, kind ); … … 1988 1997 strcat( str, lfilname ); 1989 1998 tffac = ff_filter_amplitude( str, frq, status ); 1999 2000 /* if the filter cannot be found with a TF_VEL/DSP prefix it is not a 2001 * simulation filter, so we need the transfer function of the filter 2002 * and the transfer function of the recording instrument. 2003 */ 2004 if (SySevere(status)) { 2005 /* at an unfiltered trace this means that the transfer function of the 2006 * recording instrument has not been found before. So nothing can 2007 * be done here. */ 2008 if (*lfilname == '\0') return; 2009 *status = cBcNoError; 2010 /* get amplification of applied filter */ 2011 tffac = ff_filter_amplitude( lfilname, frq, status ); 2012 printf( "SHM-dbg2: fac1: filter applied: %s -> %f\n", lfilname, tffac ); 2013 if (SySevere(status)) return; 2014 /* add transfer function of recording instrument (like code above) */ 2015 locstat = cBcNoError; 2016 db_gett( trcptr, ET_START, &ttime, &locstat ); 2017 tc_a2t( &ttime, strtime, &locstat ); 2018 cu_get_stream_string( trcptr, str, status ); 2019 if (SySevere(status)) return; 2020 cu_lookup_filter( str, strtime, lfilname, &trcflags, status ); 2021 if (SySevere(status)) return; 2022 strcpy( str, "TF_" ); 2023 strcat( str, kind ); 2024 strcat( str, "_" ); 2025 strcat( str, lfilname ); 2026 tffac2 = ff_filter_amplitude( str, frq, status ); 2027 printf( "SHM-dbg2: fac2: transfer function of rec. instr. %s -> %f\n", 2028 str, tffac2 ); 2029 tffac *= tffac2; 2030 } /*endif*/ 1990 2031 1991 2032 if (GpGetInt(cGpI_debug_level) > 1)
Note: See TracChangeset
for help on using the changeset viewer.