GNU Radio 3.6.5 C++ API

gr::blocks Namespace Reference

Namespaces

namespace  pdu

Classes

class  add_ff
 output = sum (input_0, input_1, ...) More...
class  annotator_1to1
 1-to-1 stream annotator testing block. FOR TESTING PURPOSES ONLY. More...
class  annotator_alltoall
 All-to-all stream annotator testing block. FOR TESTING PURPOSES ONLY. More...
class  annotator_raw
 raw stream annotator testing block. More...
class  bin_statistics_f
 control scanning and record frequency domain statistics More...
class  burst_tagger
 Sets a burst on/off tag based on the value of the trigger input. More...
class  char_to_float
 Convert stream of chars to a stream of float. More...
class  char_to_short
 Convert stream of chars to a stream of short. More...
class  check_lfsr_32k_s
 sink that checks if its input stream consists of a lfsr_32k sequence. More...
class  complex_to_arg
 complex in, arg out (float) More...
class  complex_to_float
 convert a stream of gr_complex to 1 or 2 streams of float More...
class  complex_to_imag
 complex in, imag out (float) More...
class  complex_to_interleaved_short
 Convert stream of complex to a stream of interleaved shorts. More...
class  complex_to_mag
 complex in, magnitude out (float) More...
class  complex_to_mag_squared
 complex in, magnitude squared out (float) More...
class  complex_to_real
 complex in, real out (float) More...
class  conjugate_cc
 output = complex conjugate of input More...
class  control_loop
class  copy
 output[i] = input[i] More...
class  deinterleave
 deinterleave a single input into N outputs More...
class  delay
 delay the input by a certain number of samples More...
class  endian_swap
 Convert stream of items into thier byte swapped version. More...
class  file_descriptor_sink
 Write stream to file descriptor. More...
class  file_descriptor_source
 Read stream from file descriptor. More...
class  file_meta_sink
 Write stream to file with meta-data headers. More...
class  file_meta_source
 Reads stream from file with meta-data headers. Headers are parsed into tags. More...
class  file_sink
 Write stream to file. More...
class  file_sink_base
 Common base class for file sinks. More...
class  file_source
 Read stream from file. More...
class  float_to_char
 Convert stream of floats to a stream of char. More...
class  float_to_complex
 one or two floats in, complex out More...
class  float_to_int
 Convert stream of floats to a stream of ints. More...
class  float_to_short
 Convert stream of floats to a stream of shorts. More...
class  float_to_uchar
 Convert stream of floats to a stream of unsigned chars. More...
class  head
 copies the first N items to the output then signals done More...
class  int_to_float
 Convert stream of ints to a stream of floats. More...
class  interleave
 interleave N inputs into a single output More...
class  interleaved_short_to_complex
 Convert stream of interleaved shorts to a stream of complex. More...
class  keep_m_in_n
 decimate a stream, keeping m items out of every n. More...
class  keep_one_in_n
 decimate a stream, keeping one item out of every n. More...
class  lfsr_15_1_0
 Linear Feedback Shift Register using primitive polynomial x^15 + x + 1. More...
class  lfsr_32k
 generate pseudo-random sequence of length 32768 bits. More...
class  lfsr_32k_source_s
 LFSR pseudo-random source with period of 2^15 bits (2^11 shorts) More...
class  message_burst_source
 Turn received messages into a stream and tag them for UHD to send. More...
class  message_debug
 Debug block for the message passing system. More...
class  message_sink
 Gather received items into messages and insert into msgq. More...
class  message_source
 Turn received messages into a stream. More...
class  message_strobe
 Send message at defined interval. More...
class  multiply_cc
 output = prod (input_0, input_1, ...) More...
class  multiply_conjugate_cc
 Multiplies stream 0 by the complex conjugate of stream 1. More...
class  multiply_const_cc
 output = input * complex constant More...
class  multiply_const_ff
 output = input * real constant More...
class  multiply_ff
 output = prod (input_0, input_1, ...) More...
class  nlog10_ff
 output = n*log10(input) + k More...
class  nop
 Does nothing. Used for testing only. More...
class  null_sink
 Bit bucket. Use as a termination point when a sink is required and we don't want to do anything real. More...
class  null_source
 A source of zeros used mainly for testing. More...
class  pack_k_bits_bb
 Converts a stream of bytes with 1 bit in the LSB to a byte with k relevent bits. More...
class  patterned_interleaver
 Interleave items based on the provided vector pattern. More...
class  pdu_to_tagged_stream
 Turns received PDUs into a tagged stream of items. More...
class  peak_detector2_fb
 Detect the peak of a signal. More...
class  plateau_detector_fb
 Detects a plateau and marks the middle. More...
class  probe_rate
 throughput measurement More...
class  regenerate_bb
 Detect the peak of a signal and repeat every period samples. More...
class  repack_bits_bb
 Pack k bits from the input stream onto l bits of the output stream. More...
class  repeat
 repeat each input repeat times More...
class  rms_cf
 RMS average power. More...
class  rms_ff
 RMS average power. More...
class  rotator
class  short_to_char
 Convert stream of shorts to a stream of chars. More...
class  short_to_float
 Convert stream of shorts to a stream of floats. More...
class  skiphead
 skips the first N items, from then on copies items to the output More...
class  socket_pdu
 Creates socket interface and translates traffic to PDUs. More...
class  stream_mux
 Stream muxing block to multiplex many streams into one with a specified format. More...
class  stream_to_streams
 convert a stream of items into a N streams of items More...
class  stream_to_vector
 convert a stream of items into a stream of blocks containing nitems_per_block More...
class  streams_to_stream
 Convert N streams of 1 item into a 1 stream of N items. More...
class  streams_to_vector
 convert N streams of items to 1 stream of vector length N More...
class  stretch_ff
 adjust y-range of an input vector by mapping to range (max-of-input, stipulated-min). Primarily for spectral signature matching by normalizing spectrum dynamic ranges. More...
class  tag_debug
 Bit bucket that prints out any tag received. More...
class  tag_gate
 Control tag propagation.Use this block to stop tags from propagating. More...
class  tagged_file_sink
 A file sink that uses tags to save files. More...
class  tagged_stream_mux
 Combines tagged streams. More...
class  tagged_stream_to_pdu
 Turns received stream data and tags into PDUs. More...
class  threshold_ff
 Output a 1 or zero based on a threshold value. More...
class  throttle
 throttle flow of samples such that the average rate does not exceed samples_per_sec. More...
class  transcendental
 A block that performs various transcendental math operations. More...
class  tuntap_pdu
 Creates TUNTAP interface and translates traffic to PDUs. More...
class  uchar_to_float
 Convert stream of unsigned chars to a stream of floats. More...
class  udp_sink
 Write stream to an UDP socket. More...
class  udp_source
 Read stream from an UDP socket. More...
class  unpack_k_bits_bb
 Converts a byte with k relevent bits to k output bytes with 1 bit in the LSB. More...
class  vco_f
 VCO - Voltage controlled oscillator. More...
class  vector_map
 Maps elements from a set of input vectors to a set of output vectors. More...
class  vector_to_stream
 convert a stream of blocks of nitems_per_block items into a stream of items More...
class  vector_to_streams
 Convert 1 stream of vectors of length N to N streams of items. More...
class  wavfile_sink
 Write stream to a Microsoft PCM (.wav) file. More...
class  wavfile_source
 Read stream from a Microsoft PCM (.wav) file, output floats. More...
class  add_ff_impl
class  annotator_1to1_impl
class  annotator_alltoall_impl
class  annotator_raw_impl
class  bin_statistics_f_impl
class  burst_tagger_impl
class  char_to_float_impl
class  char_to_short_impl
class  check_lfsr_32k_s_impl
class  complex_to_arg_impl
class  complex_to_float_impl
class  complex_to_imag_impl
class  complex_to_interleaved_short_impl
class  complex_to_mag_impl
class  complex_to_mag_squared_impl
class  complex_to_real_impl
class  conjugate_cc_impl
class  copy_impl
class  deinterleave_impl
class  delay_impl
class  endian_swap_impl
class  file_descriptor_sink_impl
class  file_descriptor_source_impl
class  file_meta_sink_impl
class  file_meta_source_impl
class  file_sink_impl
class  file_source_impl
class  float_to_char_impl
class  float_to_complex_impl
class  float_to_int_impl
class  float_to_short_impl
class  float_to_uchar_impl
class  head_impl
class  int_to_float_impl
class  interleave_impl
class  interleaved_short_to_complex_impl
class  keep_m_in_n_impl
class  keep_one_in_n_impl
class  lfsr_32k_source_s_impl
class  message_burst_source_impl
class  message_debug_impl
class  message_sink_impl
class  message_source_impl
class  message_strobe_impl
class  multiply_cc_impl
class  multiply_conjugate_cc_impl
class  multiply_const_cc_impl
class  multiply_const_ff_impl
class  multiply_ff_impl
class  nlog10_ff_impl
class  nop_impl
class  null_sink_impl
class  null_source_impl
class  pack_k_bits_bb_impl
class  patterned_interleaver_impl
class  pdu_to_tagged_stream_impl
class  peak_detector2_fb_impl
class  plateau_detector_fb_impl
class  probe_rate_impl
class  regenerate_bb_impl
class  repack_bits_bb_impl
class  repeat_impl
class  rms_cf_impl
 RMS average power. More...
class  rms_ff_impl
 RMS average power. More...
class  short_to_char_impl
class  short_to_float_impl
class  skiphead_impl
class  socket_pdu_impl
class  stream_mux_impl
class  stream_pdu_base
class  stream_to_streams_impl
class  stream_to_vector_impl
class  streams_to_stream_impl
class  streams_to_vector_impl
class  stretch_ff_impl
class  tag_debug_impl
class  tag_gate_impl
class  tagged_file_sink_impl
class  tagged_stream_mux_impl
class  tagged_stream_to_pdu_impl
class  tcp_connection
class  threshold_ff_impl
class  throttle_impl
class  transcendental_impl
class  tuntap_pdu_impl
class  uchar_to_float_impl
class  udp_sink_impl
class  udp_source_impl
class  unpack_k_bits_bb_impl
class  vco_f_impl
class  vector_map_impl
class  vector_to_stream_impl
class  vector_to_streams_impl
class  wavfile_sink_impl
class  wavfile_source_impl
class  add_cc
 output = sum (input_0, input_1, ...) More...
class  add_const_cc
 output = input + constant More...
class  add_const_ff
 output = input + constant More...
class  add_const_ii
 output = input + constant More...
class  add_const_ss
 output = input + constant More...
class  add_const_vcc
 output = input + constant vector More...
class  add_const_vff
 output = input + constant vector More...
class  add_const_vii
 output = input + constant vector More...
class  add_const_vss
 output = input + constant vector More...
class  add_ii
 output = sum (input_0, input_1, ...) More...
class  add_ss
 output = sum (input_0, input_1, ...) More...
class  and_bb
 output = input_0 & input_1 & , ... & input_N)bitwise boolean and across all input streams. More...
class  and_const_bb
 output_N = input_N & valuebitwise boolean and of const to the data stream. More...
class  and_const_ii
 output_N = input_N & valuebitwise boolean and of const to the data stream. More...
class  and_const_ss
 output_N = input_N & valuebitwise boolean and of const to the data stream. More...
class  and_ii
 output = input_0 & input_1 & , ... & input_N)bitwise boolean and across all input streams. More...
class  and_ss
 output = input_0 & input_1 & , ... & input_N)bitwise boolean and across all input streams. More...
class  argmax_fs
 Compares vectors from multiple streams and determines the index in the vector and stream number where the maximum value occurred. More...
class  argmax_is
 Compares vectors from multiple streams and determines the index in the vector and stream number where the maximum value occurred. More...
class  argmax_ss
 Compares vectors from multiple streams and determines the index in the vector and stream number where the maximum value occurred. More...
class  divide_cc
 output = input_0 / input_1 / input_x ...) More...
class  divide_ff
 output = input_0 / input_1 / input_x ...) More...
class  divide_ii
 output = input_0 / input_1 / input_x ...) More...
class  divide_ss
 output = input_0 / input_1 / input_x ...) More...
class  integrate_cc
 Integrate successive samples and decimate. More...
class  integrate_ff
 Integrate successive samples and decimate. More...
class  integrate_ii
 Integrate successive samples and decimate. More...
class  integrate_ss
 Integrate successive samples and decimate. More...
class  max_ff
 Compares vectors from multiple streams and determines the maximum value from each vector over all streams. More...
class  max_ii
 Compares vectors from multiple streams and determines the maximum value from each vector over all streams. More...
class  max_ss
 Compares vectors from multiple streams and determines the maximum value from each vector over all streams. More...
class  moving_average_cc
 output is the moving sum of the last N samples, scaled by the scale factor More...
class  moving_average_ff
 output is the moving sum of the last N samples, scaled by the scale factor More...
class  moving_average_ii
 output is the moving sum of the last N samples, scaled by the scale factor More...
class  moving_average_ss
 output is the moving sum of the last N samples, scaled by the scale factor More...
class  multiply_const_ii
 output = input * constant More...
class  multiply_const_ss
 output = input * constant More...
class  multiply_const_vcc
 output = input * constant vector (element-wise) More...
class  multiply_const_vff
 output = input * constant vector (element-wise) More...
class  multiply_const_vii
 output = input * constant vector (element-wise) More...
class  multiply_const_vss
 output = input * constant vector (element-wise) More...
class  multiply_ii
 output = prod (input_0, input_1, ...) More...
class  multiply_ss
 output = prod (input_0, input_1, ...) More...
class  mute_cc
 output = input or zero if muted. More...
class  mute_ff
 output = input or zero if muted. More...
class  mute_ii
 output = input or zero if muted. More...
class  mute_ss
 output = input or zero if muted. More...
class  not_bb
 output = ~inputbitwise boolean not of input streams. More...
class  not_ii
 output = ~inputbitwise boolean not of input streams. More...
class  not_ss
 output = ~inputbitwise boolean not of input streams. More...
class  or_bb
 output = input_0 | input_1 | , ... | input_N)Bitwise boolean or across all input streams. More...
class  or_ii
 output = input_0 | input_1 | , ... | input_N)Bitwise boolean or across all input streams. More...
class  or_ss
 output = input_0 | input_1 | , ... | input_N)Bitwise boolean or across all input streams. More...
class  packed_to_unpacked_bb
 Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. More...
class  packed_to_unpacked_ii
 Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. More...
class  packed_to_unpacked_ss
 Convert a stream of packed bytes or shorts to stream of unpacked bytes or shorts. More...
class  peak_detector_fb
 Detect the peak of a signal. More...
class  peak_detector_ib
 Detect the peak of a signal. More...
class  peak_detector_sb
 Detect the peak of a signal. More...
class  probe_signal_b
 Sink that allows a sample to be grabbed from Python. More...
class  probe_signal_c
 Sink that allows a sample to be grabbed from Python. More...
class  probe_signal_f
 Sink that allows a sample to be grabbed from Python. More...
class  probe_signal_i
 Sink that allows a sample to be grabbed from Python. More...
class  probe_signal_s
 Sink that allows a sample to be grabbed from Python. More...
class  probe_signal_vb
 Sink that allows a vector of samples to be grabbed from Python. More...
class  probe_signal_vc
 Sink that allows a vector of samples to be grabbed from Python. More...
class  probe_signal_vf
 Sink that allows a vector of samples to be grabbed from Python. More...
class  probe_signal_vi
 Sink that allows a vector of samples to be grabbed from Python. More...
class  probe_signal_vs
 Sink that allows a vector of samples to be grabbed from Python. More...
class  sample_and_hold_bb
 sample and hold circuit More...
class  sample_and_hold_ff
 sample and hold circuit More...
class  sample_and_hold_ii
 sample and hold circuit More...
class  sample_and_hold_ss
 sample and hold circuit More...
class  sub_cc
 output = input_0 - input_1 - ...) More...
class  sub_ff
 output = input_0 - input_1 - ...) More...
class  sub_ii
 output = input_0 - input_1 - ...) More...
class  sub_ss
 output = input_0 - input_1 - ...) More...
class  unpacked_to_packed_bb
 Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. More...
class  unpacked_to_packed_ii
 Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. More...
class  unpacked_to_packed_ss
 Convert a stream of unpacked bytes or shorts into a stream of packed bytes or shorts. More...
class  vector_insert_b
 source of unsigned char's that gets its data from a vector More...
class  vector_insert_c
 source of gr_complex's that gets its data from a vector More...
class  vector_insert_f
 source of float's that gets its data from a vector More...
class  vector_insert_i
 source of int's that gets its data from a vector More...
class  vector_insert_s
 source of short's that gets its data from a vector More...
class  vector_sink_b
 unsigned char sink that writes to a vector More...
class  vector_sink_c
 gr_complex sink that writes to a vector More...
class  vector_sink_f
 float sink that writes to a vector More...
class  vector_sink_i
 int sink that writes to a vector More...
class  vector_sink_s
 short sink that writes to a vector More...
class  vector_source_b
 source of unsigned char's that gets its data from a vector More...
class  vector_source_c
 source of gr_complex's that gets its data from a vector More...
class  vector_source_f
 source of float's that gets its data from a vector More...
class  vector_source_i
 source of int's that gets its data from a vector More...
class  vector_source_s
 source of short's that gets its data from a vector More...
class  xor_bb
 output = input_0 ^ input_1 ^ , ... ^ input_N)Bitwise boolean xor across all input streams. More...
class  xor_ii
 output = input_0 ^ input_1 ^ , ... ^ input_N)Bitwise boolean xor across all input streams. More...
class  xor_ss
 output = input_0 ^ input_1 ^ , ... ^ input_N)Bitwise boolean xor across all input streams. More...
class  add_cc_impl
class  add_const_cc_impl
class  add_const_ff_impl
class  add_const_ii_impl
class  add_const_ss_impl
class  add_const_vcc_impl
class  add_const_vff_impl
class  add_const_vii_impl
class  add_const_vss_impl
class  add_ii_impl
class  add_ss_impl
class  and_bb_impl
class  and_const_bb_impl
class  and_const_ii_impl
class  and_const_ss_impl
class  and_ii_impl
class  and_ss_impl
class  argmax_fs_impl
class  argmax_is_impl
class  argmax_ss_impl
class  divide_cc_impl
class  divide_ff_impl
class  divide_ii_impl
class  divide_ss_impl
class  integrate_cc_impl
class  integrate_ff_impl
class  integrate_ii_impl
class  integrate_ss_impl
class  max_ff_impl
class  max_ii_impl
class  max_ss_impl
class  moving_average_cc_impl
class  moving_average_ff_impl
class  moving_average_ii_impl
class  moving_average_ss_impl
class  multiply_const_ii_impl
class  multiply_const_ss_impl
class  multiply_const_vcc_impl
class  multiply_const_vff_impl
class  multiply_const_vii_impl
class  multiply_const_vss_impl
class  multiply_ii_impl
class  multiply_ss_impl
class  mute_cc_impl
class  mute_ff_impl
class  mute_ii_impl
class  mute_ss_impl
class  not_bb_impl
class  not_ii_impl
class  not_ss_impl
class  or_bb_impl
class  or_ii_impl
class  or_ss_impl
class  packed_to_unpacked_bb_impl
class  packed_to_unpacked_ii_impl
class  packed_to_unpacked_ss_impl
class  peak_detector_fb_impl
class  peak_detector_ib_impl
class  peak_detector_sb_impl
class  probe_signal_b_impl
class  probe_signal_c_impl
class  probe_signal_f_impl
class  probe_signal_i_impl
class  probe_signal_s_impl
class  probe_signal_vb_impl
class  probe_signal_vc_impl
class  probe_signal_vf_impl
class  probe_signal_vi_impl
class  probe_signal_vs_impl
class  sample_and_hold_bb_impl
class  sample_and_hold_ff_impl
class  sample_and_hold_ii_impl
class  sample_and_hold_ss_impl
class  sub_cc_impl
class  sub_ff_impl
class  sub_ii_impl
class  sub_ss_impl
class  unpacked_to_packed_bb_impl
class  unpacked_to_packed_ii_impl
class  unpacked_to_packed_ss_impl
class  vector_insert_b_impl
class  vector_insert_c_impl
class  vector_insert_f_impl
class  vector_insert_i_impl
class  vector_insert_s_impl
class  vector_sink_b_impl
class  vector_sink_c_impl
class  vector_sink_f_impl
class  vector_sink_i_impl
class  vector_sink_s_impl
class  vector_source_b_impl
class  vector_source_c_impl
class  vector_source_f_impl
class  vector_source_i_impl
class  vector_source_s_impl
class  xor_bb_impl
class  xor_ii_impl
class  xor_ss_impl

Typedefs

typedef int(* work_fcn_type )(int, gr_vector_const_void_star &, gr_vector_void_star &)

Enumerations

enum  gr_file_types {
  GR_FILE_BYTE = 0, GR_FILE_CHAR = 0, GR_FILE_SHORT = 1, GR_FILE_INT,
  GR_FILE_LONG, GR_FILE_LONG_LONG, GR_FILE_FLOAT, GR_FILE_DOUBLE
}

Functions

BLOCKS_API unsigned int count_bits8 (unsigned int x)
 return number of set bits in the low 8 bits of x
BLOCKS_API unsigned int count_bits16 (unsigned int x)
 return number of set bits in the low 16 bits of x
BLOCKS_API unsigned int count_bits32 (unsigned int x)
 return number of set bits in the low 32 bits of x
BLOCKS_API unsigned int count_bits64 (unsigned long long int x)
 return number of set bits in a 64-bit word
template<unsigned int k>
static int log2_const ()
template<>
int log2_const< 1 > ()
template<>
int log2_const< 2 > ()
template<>
int log2_const< 4 > ()
template<>
int log2_const< 8 > ()
template<>
int log2_const< 16 > ()
template<>
int log2_const< 32 > ()
template<>
int log2_const< 64 > ()
template<>
int log2_const< 128 > ()
template<>
int log2_const< 256 > ()
template<>
int log2_const< 512 > ()
template<>
int log2_const< 1024 > ()
bool wavheader_parse (FILE *fp, unsigned int &sample_rate, int &nchans, int &bytes_per_sample, int &first_sample_pos, unsigned int &samples_per_chan)
 Read signal information from a given WAV file.
short int wav_read_sample (FILE *fp, int bytes_per_sample)
 Read one sample from an open WAV file at the current position.
bool wavheader_write (FILE *fp, unsigned int sample_rate, int nchans, int bytes_per_sample)
 Write a valid RIFF file header.
void wav_write_sample (FILE *fp, short int sample, int bytes_per_sample)
 Write one sample to an open WAV file at the current position.
bool wavheader_complete (FILE *fp, unsigned int byte_count)
 Complete a WAV header.

Variables

const char METADATA_VERSION = 0
const size_t METADATA_HEADER_SIZE = 149

Typedef Documentation


Enumeration Type Documentation

Enumerator:
GR_FILE_BYTE 
GR_FILE_CHAR 
GR_FILE_SHORT 
GR_FILE_INT 
GR_FILE_LONG 
GR_FILE_LONG_LONG 
GR_FILE_FLOAT 
GR_FILE_DOUBLE 

Function Documentation

BLOCKS_API unsigned int gr::blocks::count_bits16 ( unsigned int  x)

return number of set bits in the low 16 bits of x

BLOCKS_API unsigned int gr::blocks::count_bits32 ( unsigned int  x)

return number of set bits in the low 32 bits of x

BLOCKS_API unsigned int gr::blocks::count_bits64 ( unsigned long long int  x)

return number of set bits in a 64-bit word

BLOCKS_API unsigned int gr::blocks::count_bits8 ( unsigned int  x)

return number of set bits in the low 8 bits of x

template<unsigned int k>
static int gr::blocks::log2_const ( ) [inline, static]
template<>
int gr::blocks::log2_const< 1 > ( ) [inline]
template<>
int gr::blocks::log2_const< 1024 > ( ) [inline]
template<>
int gr::blocks::log2_const< 128 > ( ) [inline]
template<>
int gr::blocks::log2_const< 16 > ( ) [inline]
template<>
int gr::blocks::log2_const< 2 > ( ) [inline]
template<>
int gr::blocks::log2_const< 256 > ( ) [inline]
template<>
int gr::blocks::log2_const< 32 > ( ) [inline]
template<>
int gr::blocks::log2_const< 4 > ( ) [inline]
template<>
int gr::blocks::log2_const< 512 > ( ) [inline]
template<>
int gr::blocks::log2_const< 64 > ( ) [inline]
template<>
int gr::blocks::log2_const< 8 > ( ) [inline]
short int gr::blocks::wav_read_sample ( FILE *  fp,
int  bytes_per_sample 
)

Read one sample from an open WAV file at the current position.

Takes care of endianness.

void gr::blocks::wav_write_sample ( FILE *  fp,
short int  sample,
int  bytes_per_sample 
)

Write one sample to an open WAV file at the current position.

Takes care of endianness.

bool gr::blocks::wavheader_complete ( FILE *  fp,
unsigned int  byte_count 
)

Complete a WAV header.

Note: The stream position is changed during this function. If anything needs to be written to the WAV file after calling this function (which shouldn't happen), you need to fseek() to the end of the file (or whereever).

Parameters:
[in]fpFile pointer to an open WAV file with a blank header
[in]byte_countLength of all samples written to the file in bytes.
bool gr::blocks::wavheader_parse ( FILE *  fp,
unsigned int &  sample_rate,
int &  nchans,
int &  bytes_per_sample,
int &  first_sample_pos,
unsigned int &  samples_per_chan 
)

Read signal information from a given WAV file.

Parameters:
[in]fpFile pointer to an opened, empty file.
[out]sample_rateStores the sample rate [S/s]
[out]nchansNumber of channels
[out]bytes_per_sampleBytes per sample, can either be 1 or 2 (corresponding o 8 or 16 bit samples, respectively)
[out]first_sample_posNumber of the first byte containing a sample. Use this with fseek() to jump from the end of the file to the first sample when in repeat mode.
[out]samples_per_chanNumber of samples per channel
Returns:
True on a successful read, false if the file could not be read or is not a valid WAV file.
bool gr::blocks::wavheader_write ( FILE *  fp,
unsigned int  sample_rate,
int  nchans,
int  bytes_per_sample 
)

Write a valid RIFF file header.

Note: Some header values are kept blank because they're usually not known a-priori (file and chunk lengths). Use gri_wavheader_complete() to fill these in.


Variable Documentation