00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef INCLUDED_GR_SIG_SOURCE_S_H
00026 #define INCLUDED_GR_SIG_SOURCE_S_H
00027
00028 #include <gr_sync_block.h>
00029 #include <gr_sig_source_waveform.h>
00030 #include <gr_fxpt_nco.h>
00031
00032 class gr_sig_source_s;
00033 typedef boost::shared_ptr<gr_sig_source_s> gr_sig_source_s_sptr;
00034
00040 class gr_sig_source_s : public gr_sync_block {
00041 friend gr_sig_source_s_sptr
00042 gr_make_sig_source_s (double sampling_freq, gr_waveform_t waveform,
00043 double frequency, double ampl, short offset);
00044
00045 double d_sampling_freq;
00046 gr_waveform_t d_waveform;
00047 double d_frequency;
00048 double d_ampl;
00049 short d_offset;
00050 gr_fxpt_nco d_nco;
00051
00052
00053 gr_sig_source_s (double sampling_freq, gr_waveform_t waveform,
00054 double wave_freq, double ampl, short offset);
00055
00056 public:
00057 virtual int work (int noutput_items,
00058 gr_vector_const_void_star &input_items,
00059 gr_vector_void_star &output_items);
00060
00061
00062 double sampling_freq () const { return d_sampling_freq; }
00063 gr_waveform_t waveform () const { return d_waveform; }
00064 double frequency () const { return d_frequency; }
00065 double amplitude () const { return d_ampl; }
00066 short offset () const { return d_offset; }
00067
00068
00069 void set_sampling_freq (double sampling_freq);
00070 void set_waveform (gr_waveform_t waveform);
00071 void set_frequency (double frequency);
00072 void set_amplitude (double ampl);
00073 void set_offset (short offset);
00074 };
00075
00076 gr_sig_source_s_sptr
00077 gr_make_sig_source_s (double sampling_freq, gr_waveform_t waveform,
00078 double wave_freq, double ampl, short offset = 0);
00079
00080
00081 #endif