diff --git a/csdr.c b/csdr.c index 4e3aec8..686b3b1 100755 --- a/csdr.c +++ b/csdr.c @@ -2877,15 +2877,45 @@ int main(int argc, char *argv[]) { if(argc<=2) badsyntax("no data to repeat"); unsigned char* repeat_buffer = (unsigned char*)malloc(sizeof(unsigned char)*(argc-2)); + if(!initialize_buffers()) return -2; + sendbufsize(the_bufsize); //this is really (c-2) but this is a very fast source block so it makes no sense to send out a small number here for(int i=0;i + + + Sun Nov 16 15:12:31 2014 + + options + + author + + + + window_size + 1280, 1024 + + + category + Custom + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (10, 10) + + + _rotation + 0 + + + generate_options + wx_gui + + + id + top_block + + + max_nouts + 0 + + + realtime_scheduling + + + + run_options + prompt + + + run + True + + + thread_safe_setters + + + + title + + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (8, 83) + + + _rotation + 0 + + + id + samp_rate + + + value + 100e3 + + + + analog_const_source_x + + alias + + + + comment + + + + const + 0 + + + affinity + + + + _enabled + True + + + _coordinate + (40, 179) + + + _rotation + 0 + + + id + analog_const_source_x_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + complex + + + + blocks_complex_to_float + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (392, 313) + + + _rotation + 0 + + + id + blocks_complex_to_float_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_throttle + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (216, 179) + + + _rotation + 0 + + + id + blocks_throttle_0 + + + ignoretag + True + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_second + 0 + + + type + complex + + + vlen + 1 + + + + blocks_throttle + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (680, 91) + + + _rotation + 0 + + + id + blocks_throttle_0_0 + + + ignoretag + True + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_second + samp_rate + + + type + complex + + + vlen + 1 + + + + blocks_throttle + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (800, 331) + + + _rotation + 0 + + + id + blocks_throttle_0_0_0 + + + ignoretag + True + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samples_per_second + samp_rate + + + type + float + + + vlen + 1 + + + + ha5kfu_execproc_xx + + alias + + + + commandline + csdr noise_f + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (400, 227) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + cc + + + + ha5kfu_execproc_xx + + alias + + + + commandline + csdr noise_f + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (568, 307) + + + _rotation + 0 + + + id + ha5kfu_execproc_xx_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + ff + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (896, 11) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0 + + + notebook + + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (976, 259) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0_0 + + + notebook + + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + float + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + analog_const_source_x_0 + blocks_throttle_0 + 0 + 0 + + + blocks_complex_to_float_0 + ha5kfu_execproc_xx_0_0 + 0 + 0 + + + blocks_throttle_0 + blocks_complex_to_float_0 + 0 + 0 + + + blocks_throttle_0 + ha5kfu_execproc_xx_0 + 0 + 0 + + + blocks_throttle_0_0 + wxgui_fftsink2_0_0 + 0 + 0 + + + blocks_throttle_0_0_0 + wxgui_fftsink2_0_0_0 + 0 + 0 + + + ha5kfu_execproc_xx_0 + blocks_throttle_0_0 + 0 + 0 + + + ha5kfu_execproc_xx_0_0 + blocks_throttle_0_0_0 + 0 + 0 + + diff --git a/libcsdr.c b/libcsdr.c index 2901331..0f97fc6 100755 --- a/libcsdr.c +++ b/libcsdr.c @@ -2249,6 +2249,24 @@ void convert_s24_f(unsigned char* input, float* output, int input_size, int bige } } +FILE* init_get_awgn_samples_f() +{ + return fopen("/dev/urandom", "r"); +} + +void get_awgn_samples_f(float* output, int output_size, FILE* status) +{ + int* pioutput = (int*)output; + fread((unsigned char*)output, sizeof(float), output_size, status); + for(int i=0;i