Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

algorithm question #6

Open
jsjs1 opened this issue Feb 24, 2018 · 1 comment
Open

algorithm question #6

jsjs1 opened this issue Feb 24, 2018 · 1 comment

Comments

@jsjs1
Copy link

jsjs1 commented Feb 24, 2018

Great work, I have enjoyed getting to play around with the simulation framework you produced.
I have two questions:

  1. For fm, why do you divide the amplitude by 2?
  2. For am, why do you detrend the unmodulated signal? What benefits does that provide?

Thanks
J

@peterhcharlton
Copy link
Owner

Hi,

Glad you've found it useful, and thanks for your questions. To answer:

  1. The coefficient of the frequency modulation specified on line 94 of this function is half that of the coefficients used for amplitude modulation and baseline wander. The coefficients are arbitrary, and I found that using the same coefficient for FM as for AM and BW resulted in extremely large variations in beat-to-beat intervals, which were too large to be close to normal physiological variations. Hence, the coefficient was halved.

  2. The detrending performed on line 240 of this function is necessary to achieve the desired amplitude modulation. Initially, the unmodulated signal occupies the range of 0 to 1. The amplitude modulation is added by multiplying the original signal values by an offset cosine function (with a mean of 1). Consequently, if the unmodulated signal was used, then the lowest values (at 0), would not be exposed to any amplitude modulation (since 0 multiplied by the cosine function will be 0). Detrending the signal prior to the multiplication ensures that both the lower and upper parts of the signal are subject to amplitude modulation. It may be helpful to visualise this by trying it with and without the detrending step.

Hope this helps

Pete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants