-
November 10th, 2008, 01:35 PM
#1
Digitally sampling analogue waveforms in C++
First of all, I am a complete newbie to the world of C++ and programming in general, so please go easy on me!
I have been set the task of creating a simple console program to investigate the effects of digitally sampling analogue waveforms.
Basically, the sampling effect needs to be investigated using a single cycle of a cos wave (i.e. 0 - 360 degs).
The program has to display the waveform by printing a character (i.e. '*') at the sampling point, one per row of output.
The user should be able to enter an odd number of sampling points from a minimum of 3 to a maximum of 37, and should be able to set a scale factor. I.e if the user entered '5' for the number of points and '20' for the scale factor, something similar to this should be seen:
__________________
Waveform analysis program
Enter number of sample points between 3 and 37: 5
Enter a scale factor between 20 and 40: 20
Waveform plot:
------------------------------------------------------------------------------*
-------------------------------------*
--------*
-------------------------------------*
------------------------------------------------------------------------------*
Run again? (Y or N): N
End of Program
______________________
{{{IGNORE the '---'s before each '*' in the waveform plot, i put these in so the '*'s remain in position when i post this!}}}
Any help whatsoever, even a starting point, would be gratefully received!!!
Thanks hugely in advance,
JP206
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|