asgramcf

Variants: asgramcf, asgramf

ASCII spectral periodogram for computing and displaying an estimate of a signal's power spectrum with ASCII characters

Public Functions

asgramcf asgramcf_create(unsigned int _nfft)
asgramcf asgramcf_copy(asgramcf _q)
int asgramcf_destroy(asgramcf _q)
int asgramcf_reset(asgramcf _q)
int asgramcf_set_scale(asgramcf _q, float _ref, float _div)
int asgramcf_set_display(asgramcf _q, const char * _ascii)
int asgramcf_push(asgramcf _q, float complex _x)
int asgramcf_write(asgramcf _q, float complex * _x, unsigned int _n)
int asgramcf_execute(asgramcf _q, char * _ascii, float * _peakval, float * _peakfreq)
int asgramcf_print(asgramcf _q)

Interfaces

asgramcf asgramcf_create(unsigned int _nfft)

Create asgram object with size _nfft

  • _nfft : size of FFT taken for each transform (character width)

asgramcf asgramcf_copy(asgramcf _q)

Copy object including all internal objects and state

int asgramcf_destroy(asgramcf _q)

Destroy asgram object, freeing all internally-allocated memory

int asgramcf_reset(asgramcf _q)

Reset the internal state of the asgram object

int asgramcf_set_scale(asgramcf _q, float _ref, float _div)

Set the scale and offset for spectrogram in terms of dB for display purposes

  • _q : asgram object
  • _ref : signal reference level [dB]
  • _div : signal division [dB]

int asgramcf_set_display(asgramcf _q, const char * _ascii)

Set the display's 10 characters for output string starting from the weakest and ending with the strongest

  • _q : asgram object
  • _ascii : 10-character display, default: " .,-+*&NM#"

int asgramcf_push(asgramcf _q, float complex _x)

Push a single sample into the asgram object, executing internal transform as necessary.

  • _q : asgram object
  • _x : input sample

int asgramcf_write(asgramcf _q, float complex * _x, unsigned int _n)

Write a block of samples to the asgram object, executing internal transforms as necessary.

  • _q : asgram object
  • _x : input buffer, shape: (_n, 1)
  • _n : input buffer length

int asgramcf_execute(asgramcf _q, char * _ascii, float * _peakval, float * _peakfreq)

Compute spectral periodogram output from current buffer contents and return the ascii character string to display along with the peak value and its frequency location

  • _q : asgram object
  • _ascii : output ASCII string, shape: (_nfft, 1)
  • _peakval : peak power spectral density value [dB]
  • _peakfreq : peak power spectral density frequency

int asgramcf_print(asgramcf _q)

Compute spectral periodogram output from current buffer contents and print standard format to stdout