/* Last edited on 2023-01-14 11:49:58 by stolfi */ double quartic_win(int32_t z, int32_t N) { double r = (z + 0.5)/N; double w = 4*r*(1 - r); return w*w; } typedef struct spectrum_table_entry_t { double fmin; /* Lower endpoint of range. */ double fmax; /* Upper endpoint of range. */ double freq; /* A middling value in range. */ double nTerms; /* Number of Hartley terms in range. */ double *power; /* Pointer to total power per channel. */ } spectrum_table_entry_t; /* An entry of a spectrum table. All Hartley spectrum terms with frequencies in {[fmin _ fmax]} are counted in {nTerms}, an the their total power per channel {c} is stored in {power[c]}. */ vec_typedef(spectrum_table_t,spectrum_table,spectrum_table_entry_t); vec_typedef(spectrum_table_t,spectrum_table,spetrum_table-entry_t);