Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106044A

 
Output of file : 1106044A contained in archive : CUJ9306.ZIP
/* funlib.c */
#include
#include
#include "funlib.h"

void fun_unit_step(
const long int wave_ary_len,
double *waveform)
{
auto unsigned long int wave_index;

for ( wave_index = 1;
wave_index <= wave_ary_len;
wave_index++)
{
waveform[wave_index]
= 1.0 / (double)wave_ary_len;
}
return;
}

void fun_noise(const long int wave_ary_len,
const double noise_width,
double *waveform)
{
auto unsigned long int wave_index;

for (wave_index = 0;
wave_index < wave_ary_len;
wave_index++)
{
waveform[wave_index]
+= noise_width
* ((double)rand() / (double)RAND_MAX);
}

return;
}


void fun_step_real(const long int wave_ary_len,
double *waveform)
{
auto unsigned long int i,
temp_len
= wave_ary_len / 2;

fun_gaussian_density(temp_len, waveform);
for (i = 0; i < wave_ary_len; i++)
{
waveform[i] = 1.0 - waveform[i];
}
for (i = 1; i < temp_len; i++)
{
waveform[i]
= waveform[i + 1 + (temp_len / 2)];
}
for (i = temp_len / 2; i < wave_ary_len; i++)
{
waveform[i] = .999;
}
waveform[0] = 0.0;
return;
}

void fun_gaussian_density(const long int wave_ary_len,
double *waveform)
{
auto unsigned long int i;
auto double x,
mean,
std_dev;
for (i = 0; i < wave_ary_len; i++)
{
mean = (double)wave_ary_len / 2.0;
std_dev = (0.7 * wave_ary_len) / 6.0;
x = (double)i;
waveform[i]
= exp(- pow((x - mean), 2.0)
/ (2.0 * pow(std_dev, 2.0)));
}
waveform[0] = 0.0;
return;
}

void fun_unit_gauss_dens(const long int wave_ary_len, double *waveform)
{
auto double area = 0.0;
auto unsigned long int wave_index;

fun_gaussian_density(wave_ary_len, waveform);
for (wave_index = 0;
wave_index < wave_ary_len; wave_index++)
{
area += waveform[wave_index];
}
for (wave_index = 0; wave_index < wave_ary_len;
wave_index++)
{
waveform[wave_index] /= area;
}
return;
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ9306.ZIP
Filename : 1106044A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/