Click here to Skip to main content
15,914,162 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralLogic Question Pin
RedDragon2k26-Mar-05 1:12
RedDragon2k26-Mar-05 1:12 
GeneralRe: Logic Question Pin
toxcct26-Mar-05 4:13
toxcct26-Mar-05 4:13 
GeneralRe: Logic Question Pin
RedDragon2k26-Mar-05 5:54
RedDragon2k26-Mar-05 5:54 
GeneralRe: Logic Question Pin
Roger Wright26-Mar-05 6:43
professionalRoger Wright26-Mar-05 6:43 
GeneralRe: Logic Question Pin
RedDragon2k26-Mar-05 8:59
RedDragon2k26-Mar-05 8:59 
GeneralRe: Logic Question Pin
Roger Wright26-Mar-05 20:46
professionalRoger Wright26-Mar-05 20:46 
GeneralRe: Logic Question Pin
RedDragon2k27-Mar-05 1:24
RedDragon2k27-Mar-05 1:24 
GeneralRe: Logic Question Pin
Roger Wright27-Mar-05 4:20
professionalRoger Wright27-Mar-05 4:20 
Interesting. How in the world did you find a way to access the LineIn on a sound card? I didn't know that it was possible. Or is this some kind of analog to digital converter card you have? There is no such thing as a Line In "port" on a PC, but sound cards have audio input jacks by that name.

If you are accessing data that can be FFT'd you should be looking at digitized analog voltages. If you want to work with the raw data, you could scan the data for peaks followed by minimums, then pick an arbitrary point halfway between them to call the transition point. The number of samples between high-to-low transitions divided by the sample rate (#samples / samples per second) will yield the time between transitions.

Simpler, though, if you have the FFT data available, is to simply locate the peak value and determine its frequency. Since this is frequency domain data, the peak represents the fundamental frequency of the input signal. That corresponds exactly with the period you're trying to determine. Each data point in the FFT output array contains the magnitude of the input signal due to a frequency that is a multiple or submultiple of the sample rate. Locating the peak will be easy - in a square wave such as you've illustrated, the fundamental component is half the peak value, and since it contains only odd harmonics there will be much smaller peaks at 3f0, 5f0, 7f0, etc. The inverse of the frequency of the largest value in the array is the period of the signal.



"If it's Snowbird season, why can't we shoot them?" - Overheard in a bar in Bullhead City
GeneralRe: Logic Question Pin
RedDragon2k27-Mar-05 21:16
RedDragon2k27-Mar-05 21:16 
GeneralRe: Logic Question Pin
Roger Wright28-Mar-05 1:56
professionalRoger Wright28-Mar-05 1:56 
GeneralDCom Pin
pardis26-Mar-05 0:58
pardis26-Mar-05 0:58 
Generalconstructor and copy constructor Pin
bobi_zcl26-Mar-05 0:03
bobi_zcl26-Mar-05 0:03 
GeneralRe: constructor and copy constructor Pin
toxcct26-Mar-05 1:00
toxcct26-Mar-05 1:00 
GeneralRe: constructor and copy constructor Pin
Michael Dunn26-Mar-05 9:49
sitebuilderMichael Dunn26-Mar-05 9:49 
Generalpentium IV bug Pin
violantly happy25-Mar-05 23:08
sussviolantly happy25-Mar-05 23:08 
GeneralRe: pentium IV bug Pin
Antony M Kancidrowski26-Mar-05 14:39
Antony M Kancidrowski26-Mar-05 14:39 
GeneralRe: pentium IV bug Pin
jidelnistul26-Mar-05 22:15
jidelnistul26-Mar-05 22:15 
GeneralRe: pentium IV bug Pin
Antony M Kancidrowski27-Mar-05 6:40
Antony M Kancidrowski27-Mar-05 6:40 
GeneralGDI+ Simple Help me Pin
Anand for every one25-Mar-05 21:34
Anand for every one25-Mar-05 21:34 
Questionwhat the header file for my backpropagation program? Pin
conniepooh25-Mar-05 19:31
conniepooh25-Mar-05 19:31 
QuestionHow to copy a File to another place using C++ Pin
pubududilena25-Mar-05 17:39
pubududilena25-Mar-05 17:39 
AnswerRe: How to copy a File to another place using C++ Pin
Anthony_Yio25-Mar-05 18:21
Anthony_Yio25-Mar-05 18:21 
AnswerRe: How to copy a File to another place using C++ Pin
David Crow26-Mar-05 7:24
David Crow26-Mar-05 7:24 
QuestionUsing XP's built-in text-to-speech functionality? Pin
IGx8925-Mar-05 17:29
IGx8925-Mar-05 17:29 
QuestionRead 3DS file for create character animation - how to ? Pin
sonla25-Mar-05 16:57
sonla25-Mar-05 16:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.