Click here to Skip to main content
15,916,288 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
JokeRe: Copy the string from const char* To char[500]; Pin
CPallini14-Jul-09 0:01
mveCPallini14-Jul-09 0:01 
QuestionPeriod and Duty cycle calculation [modified] Pin
sks8313-Jul-09 20:37
sks8313-Jul-09 20:37 
AnswerRe: Period and Duty cycle calculation Pin
LittleYellowBird13-Jul-09 21:52
LittleYellowBird13-Jul-09 21:52 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 22:17
sks8313-Jul-09 22:17 
GeneralRe: Period and Duty cycle calculation Pin
Stuart Dootson13-Jul-09 22:32
professionalStuart Dootson13-Jul-09 22:32 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 23:01
sks8313-Jul-09 23:01 
GeneralRe: Period and Duty cycle calculation Pin
Stuart Dootson13-Jul-09 23:05
professionalStuart Dootson13-Jul-09 23:05 
GeneralRe: Period and Duty cycle calculation Pin
Cedric Moonen13-Jul-09 23:07
Cedric Moonen13-Jul-09 23:07 
If your waves are "pure" (square, sine or pure triangular), you could calculate the time were the signal is positive and negative. You add those two times and you end up with the total period. The ratio of those times will give you the duty cycle.

To calculate those times, this is quite easy: simply walk over your points and check when the sign changes. At that time, you keep the time (start time) and walk over the data until the sign change (stop time). The difference between stop and start time gives you the time were the signal is negative or positive (depending of the sign).

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

GeneralRe: Period and Duty cycle calculation [modified] Pin
sks8313-Jul-09 23:12
sks8313-Jul-09 23:12 
GeneralRe: Period and Duty cycle calculation Pin
Cedric Moonen13-Jul-09 23:19
Cedric Moonen13-Jul-09 23:19 
GeneralRe: Period and Duty cycle calculation Pin
sks8313-Jul-09 23:56
sks8313-Jul-09 23:56 
GeneralRe: Period and Duty cycle calculation Pin
LittleYellowBird14-Jul-09 0:05
LittleYellowBird14-Jul-09 0:05 
Questioncommand buttons in SDI Pin
Member 59031013-Jul-09 20:27
Member 59031013-Jul-09 20:27 
AnswerRe: command buttons in SDI Pin
_AnsHUMAN_ 13-Jul-09 20:35
_AnsHUMAN_ 13-Jul-09 20:35 
Questiondatetime control on Windows mobile 5.0 win32 application. Pin
zakkas248313-Jul-09 20:23
zakkas248313-Jul-09 20:23 
QuestionRe: datetime control on Windows mobile 5.0 win32 application. Pin
David Crow14-Jul-09 9:02
David Crow14-Jul-09 9:02 
QuestionSocket Pin
navneet198513-Jul-09 20:15
navneet198513-Jul-09 20:15 
AnswerRe: Socket Pin
Michael Schubert14-Jul-09 0:52
Michael Schubert14-Jul-09 0:52 
Questionhow to detect the data on the transmission line when using a comport Pin
jitendrapothuru13-Jul-09 19:55
jitendrapothuru13-Jul-09 19:55 
QuestionRe: how to detect the data on the transmission line when using a comport Pin
CPallini13-Jul-09 21:33
mveCPallini13-Jul-09 21:33 
AnswerRe: how to detect the data on the transmission line when using a comport Pin
jitendrapothuru13-Jul-09 22:13
jitendrapothuru13-Jul-09 22:13 
QuestionRe: how to detect the data on the transmission line when using a comport Pin
CPallini13-Jul-09 22:15
mveCPallini13-Jul-09 22:15 
AnswerRe: how to detect the data on the transmission line when using a comport Pin
jitendrapothuru13-Jul-09 22:20
jitendrapothuru13-Jul-09 22:20 
GeneralRe: how to detect the data on the transmission line when using a comport Pin
CPallini13-Jul-09 23:04
mveCPallini13-Jul-09 23:04 
GeneralRe: how to detect the data on the transmission line when using a comport Pin
jitendrapothuru13-Jul-09 23:29
jitendrapothuru13-Jul-09 23:29 

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.