When your computer goes *crrrunch* . . . . . .

aneeshm

Deity
Joined
Aug 26, 2001
Messages
6,666
Location
Mountain View, California, USA
Today , in computer class , having completed my work , I thought I'd do something trivial and interesting . So I whipped together a simple program to simulate the sound of a siren ( setting the base frequency , variance , delay , and number of repetitions ) .

For the technically oriented ( if you're not interested , skip right to the end ) ( the code is old , I had to make it work on Turbo C++ ) :

Code:
#include<stdlib.h>
#include<dos.h>
//using namespace std;

int base,variance,del,repeat,current;

void ascend(int &,int &,int &);	/* The format of the above function is
 * acsend(current value of frequency , amount to ascend , delay in
 * milliseconds)
 */

void descend(int &,int &,int &);
/* The format remains the same , except that instead of amount to ascend ,
 * you give the amount to descend .
 */

int main(int argc , char *argv[])
{
	/* The format of the command-line parameters to pass
	 * to the program is rather simple .
	 *
	 * The 1st argument is the base frequency ( representing the
	 * sine x-axis) .
	 *
	 * The 2nd argument is the variance , or the amplitude of the sine
	 * wave .
	 *
	 * The 3rd argument is the delay ( in milliseconds ) , representing
	 * the delay between frequency change in the ascent and descent
	 * functions .
	 *
	 * The 4th argument is the number of times you want the siren to loop .
	 */

	int i;

	base=atoi(argv[1]);
	variance=atoi(argv[2]);
	del=atoi(argv[3]);
	repeat=atoi(argv[4]);

	/* The following for loop asends to the top , descends to the base ,
	 * then descends to the bottom , and finally ascends to the base .
	 * To do : convert it into an approximation of a sine function from
	 * a linear one .*/

	for(i=0;i<repeat;i++)
	{
		current=base;
		ascend(current,variance,del);
		descend(current,variance,del);
		descend(current,variance,del);
		ascend(current,variance,del);
	}

	return 0;
}

void ascend(int &current,int &variance,int &del)
{
	for(int i=0;i<=variance;i++)
	{
		if(i)
			current++;
		/* The preceding code makes sure that even if the loop loops
		 * (variance+1) times , current is incremented only (variance)
		 * times . It also makes sure that at least one sound is heard
		 * at the base frequency ( or that the value starts from and
		 * returns to the base frequency ) . This same approach is used
		 * in the descend function . */
		sound(current);
		delay(del);
	}

	nosound();
}

void descend(int &current,int &variance,int &del)
{
	for(int i=variance;i>=0;i--)
	{
		if(i)
			current--;
		/* See the previous comment on this topic in the ascend
		 * function . Here , the value of base is devremented on the
		 * first run , too , to ensure that top and base values
		 * are not repeated .
		 */
		sound(current);
		delay(del);
	}

	nosound();
}

So when I ran this thing , with base frequency = 5000 , and variance 5000 , it effectively ran over the frequency range (5000 - 5000 =) 0 to 10000 (= 5000 + 5000) , I could hear a *crrunch* sound at some point .

It seems that the resonance frequency of weither the cabinets or the motherboard of the computer was in this range , and so it was going *crrrunch* when I ran this .

I'd like to ask if this could have damaged the computers seriously , and also if anyone else has such anecdotes to relate .
 
Interesting.

I have made some programs myself using the pc-speaker and making beeps of different frequency.

Though I have never gotten a resonance from the computer.

Did the resonance last for long before it stopped?

It seems that the computer is still working, in which case I doubt anything were destroyed. Motherboards are somewhat flexible, so I wouldn't be to worried.
 
What kind of debugging did you do? Something I would do is put some checkpoints inside the ascend and descend functions to make sure the parameters are correct. The first thing I suspected was that the program was running from lowest frequency to highest way too fast (which would sound pretty much like white noise, or maybe a crunching sound).

As to physically damaging your computer--I once managed to set my monitor at work on fire..... :eek:
 
You bette hope you did'nt daamge the motherboard.
It's damn hard to replac it. I mean REALLY damn hard to replace. And expensive too. It costs like $21,000 Rs for a new one cuz they don't have a single one in the whole damn country so they need to export it from Singapore or something. Hell you could get a X-box at Fourm for that price.
So yeah if the motherboard is damaged you're really screwed.
 
Reasonance studies like this were very important back in the cold war, when both sides where studying radio surveillance.

They were using hardware frequency generators rather than PCs, but the effects were the same.

I doubt very much if you've damaged anything. The frequencies a modern PC has cope with are way outside human hearing range.

EDIT: I wuldn't KEEP doing it though. You could just hit the right harmonic to make all the screwthreads loosen themselves.
 
silver 2039 said:
You bette hope you did'nt daamge the motherboard.
It's damn hard to replac it. I mean REALLY damn hard to replace. And expensive too. It costs like $21,000 Rs for a new one cuz they don't have a single one in the whole damn country so they need to export it from Singapore or something. Hell you could get a X-box at Fourm for that price.
So yeah if the motherboard is damaged you're really screwed.

WHAT ? I just got an estimate for a motherboard + processor combo at about Rs. 7,500 ( I'm planning to pugrade my ASUS otherboard + Athlon XP 2000 to some other motherboard + an Athlon XP x86_64 2800 + or 3200 + ) . You must be thinking about something else .
 
Back
Top Bottom