var presentation = ["circular water puddle<\/word>","periodically<\/word>","produce disturbances<\/word>","point<\/word>","concentric circles<\/word>","same frequency<\/word>","approaching<\/word>","Suppose that there is a happy bug in the center of a circular water puddle<\/strong>. The bug is periodically<\/strong> shaking its legs in order to produce disturbances<\/strong> that travel through the water. If these disturbances originate at a point<\/strong>, then they would travel outward from that point<\/strong> in all directions. Since each disturbance is traveling in the same medium, they would all travel in every direction at the same speed. The pattern produced by the bug's shaking would be a series of concentric circles<\/strong> as shown in the diagram at the right. These circles would reach the edges of the water puddle at the same frequency<\/strong>. An observer at point<\/strong> A (the left edge of the puddle) would observe the disturbances to strike the puddle's edge at the same frequency<\/strong> that would be observed by an observer at point<\/strong> B (at the right edge of the puddle). In fact, the frequency at which disturbances reach the edge of the puddle would be the same as the frequency at which the bug produces the disturbances. If the bug produces disturbances at a frequency of 2 per second, then each observer would observe them approaching<\/strong> at a frequency of 2 per second.<\/phrase>","moving to the right<\/word>","same frequency<\/word>","closer to observer B<\/word>","farther from observer A<\/word>","shorter distance<\/word>","less time<\/word>","higher<\/word>","further distance<\/word>","less<\/word>","This effect is known as the Doppler effect<\/word>","Now suppose that our bug is moving to the right<\/strong> across the puddle of water and producing disturbances at the same frequency<\/strong> of 2 disturbances per second. Since the bug is moving towards the right, each consecutive disturbance originates from a position that is closer to observer B<\/strong> and farther from observer A<\/strong>. Subsequently, each consecutive disturbance has a shorter distance<\/strong> to travel before reaching observer B and thus takes less time<\/strong> to reach observer B. Thus, observer B observes that the frequency of arrival of the disturbances is higher<\/strong> than the frequency at which disturbances are produced. On the other hand, each consecutive disturbance has a further distance<\/strong> to travel before reaching observer A. For this reason, observer A observes a frequency of arrival that is less<\/strong> than the frequency at which the disturbances are produced. The net effect of the motion of the bug (the source of waves) is that the observer towards whom the bug is moving observes a frequency that is higher<\/strong> than 2 disturbances\/second; and the observer away from whom the bug is moving observes a frequency that is less<\/strong> than 2 disturbances\/second. This effect is known as the Doppler effect<\/strong>.<\/phrase>","whenever the source of waves is moving<\/word>","moving source<\/word>","apparent upward shift<\/word>","approaching<\/word>","apparent downward shift<\/word>","receding<\/word>","does not result<\/word>","actual change in the frequency<\/word>","appears<\/word>","only observed<\/word>","distance<\/word>","decreasing<\/word>","increasing<\/word>","The Doppler effect is observed whenever the source of waves is moving<\/strong> with respect to an observer. The Doppler effect can be described as the effect produced by a moving source<\/strong> of waves in which there is an apparent upward shift<\/strong> in frequency for observers towards whom the source is approaching<\/strong> and an apparent downward shift<\/strong> in frequency for observers from whom the source is receding<\/strong>. It is important to note that the effect does not result<\/strong> because of an actual change in the frequency<\/strong> of the source. Using the example above, the bug is still producing disturbances at a rate of 2 disturbances per second; it just appears<\/strong> to the observer whom the bug is approaching<\/strong> that the disturbances are being produced at a frequency greater than 2 disturbances\/second. The effect is only observed<\/strong> because the distance<\/strong> between observer B and the bug is decreasing<\/strong> and the distance<\/strong> between observer A and the bug is increasing<\/strong>.<\/phrase>","any type of wave<\/word>","towards you<\/word>","approached<\/word>","pitch<\/word>","high<\/word>","suddenly<\/word>","passed<\/word>","low<\/word>","apparent shift in frequency<\/word>","moving source<\/word>","The Doppler effect can be observed for any type of wave<\/strong> - water wave, sound wave, light wave, etc. We are most familiar with the Doppler effect because of our experiences with sound waves. Perhaps you recall an instance in which a police car or emergency vehicle was traveling towards you<\/strong> on the highway. As the car approached<\/strong> with its siren blasting, the pitch<\/strong> of the siren sound (a measure of the siren's frequency) was high<\/strong>; and then suddenly<\/strong> after the car passed<\/strong> by, the pitch<\/strong> of the siren sound was low<\/strong>. That was the Doppler effect - an apparent shift in frequency<\/strong> for a sound wave produced by a moving source<\/strong>.<\/phrase>","shift in frequency<\/word>","moving stars<\/word>","derive information<\/word>","universe is expanding<\/word>","observations<\/word>","waves emitted by stars<\/word>","information about stars<\/word>","determined by application of the Doppler effect<\/word>","rotate<\/word>","point<\/word>","shifted downward<\/word>","redshift<\/word>","away from the Earth<\/word>","blueshift<\/word>","towards the Earth<\/word>","The Doppler effect is of intense interest to astronomers who use the information about the shift in frequency<\/strong> of electromagnetic waves produced by moving stars<\/strong> in our galaxy and beyond in order to derive information<\/strong> about those stars and galaxies. The belief that the universe is expanding<\/strong> is based in part upon observations<\/strong> of electromagnetic waves emitted by stars<\/strong> in distant galaxies. Furthermore, specific information about stars<\/strong> within galaxies can be determined by application of the Doppler effect<\/strong>. Galaxies are clusters of stars that typically rotate<\/strong> about some center of mass point<\/strong>. Electromagnetic radiation emitted by such stars in a distant galaxy would appear to be shifted downward<\/strong> in frequency (a redshift<\/strong>) if the star is rotating in its cluster in a direction that is away from the Earth<\/strong>. On the other hand, there is an upward shift in frequency<\/strong> (a blueshift<\/strong>) of such observed radiation if the star is rotating in a direction that is towards the Earth<\/strong>.<\/phrase>"]; var currentPosition = 0; var totalPositions = 0; var timePerWord = 1500; var timePerPhraseWord = 120 var readAheadPlayerTimer; var autoPlay = true; var setMinimized = false; var wordSpeedOptions = {'Slower':2000,'Moderate':1200,'Fast':800}; var phraseSpeedOptions = {'Slower':280,'Moderate':200,'Fast':80}; var defaultWordSpeedOption = 'Moderate'; var defaultPhraseSpeedOption = 'Moderate'; var logToLTI = false; $(window).load(function(){ totalPositions = presentation.length; if (totalPositions > 0){ $('body').prepend('
'); $('body').prepend('
'); $('#read_ahead_player').prepend('
'); initializeReadAheadControls(); initializeReadAheadSlider(); initializeReadAheadSpeedOptions(); currentReadAheadControls(); resumeReadAheadPlayback(); } }); $(document).keyup(function(e){ switch(e.which) { case 37: pauseReadAheadPresentation(); priorReadAheadPresentationItem(); break; case 39: pauseReadAheadPresentation(); nextReadAheadPresentationItem(); break; default: break; } }); function initializeReadAheadControls(){ var s = ''; s += ''; s += ''; s += ''; s += '
'; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += ''; s += '
'; $('#read_ahead_player').append(s); } function initializeReadAheadSlider(){ var s = ''; s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').prepend(s); updateReadAheadSliderPosition(); } function initializeReadAheadSpeedOptions(){ var s = '
'; s += '
'; s += ' Word Speed
'; s += '
'; optionCount = 0; for (index in wordSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in wordSpeedOptions) { var option = wordSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadWordSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; s += ' Phrase Speed
'; s += '
'; optionCount = 0; for (index in phraseSpeedOptions) { optionCount++; } optionWidth = 100 / optionCount; for (index in phraseSpeedOptions) { var option = phraseSpeedOptions[index]; if (index == defaultWordSpeedOption) { s += ''; updateReadAheadPhraseSpeed(option); } else { s += ''; } } s += '
'; s += '
'; s += '
'; $('#read_ahead_controls').append(s); } function updateReadAheadWordSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0) { timePerWord = microseconds; } if (sender!=undefined) { $('#slider_control_word_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadWordSpeed','Presentation',microseconds); } function updateReadAheadPhraseSpeed(microseconds,sender) { microseconds = microseconds != undefined && microseconds > 0 ? microseconds : 0; if (microseconds > 0 ) { timePerPhraseWord = microseconds; } if (sender!=undefined) { $('#slider_control_phrase_speed').find('a').removeClass('current_speed'); $(sender).addClass('current_speed'); } logReadAheadPlayerAction('updateReadAheadPhraseSpeed','Presentation',microseconds); } function updateReadAheadSliderPosition(){ var currentSliderBarWidth = 100 - (100 / totalPositions * (currentPosition + 1)); $('#readAheadSliderBar').css('width',currentSliderBarWidth+'%'); } function currentReadAheadControls(){ $('#read_ahead_player_pause_play').show(); if (currentPosition < totalPositions - 1) { $('#read_ahead_player_next_word').removeClass('disabled'); } else { $('#read_ahead_player_next_word').addClass('disabled'); } if (currentPosition > 0) { $('#read_ahead_player_previous_word').removeClass('disabled'); } else { $('#read_ahead_player_previous_word').addClass('disabled'); } } function restartReadAheadPresentation(){ currentPosition = 0; logReadAheadPlayerAction('restartReadAheadPresentation','Presentation',''); resumeReadAheadPlayback(); } function resumeReadAheadPlayback(){ $('.fa-repeat').removeClass('fa-repeat').addClass('fa-play'); $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-play').removeClass('fa-play').addClass('fa-pause'); $(this).off('click'); $(this).attr('onclick','pauseReadAheadPresentation()'); }); logReadAheadPlayerAction('resumeReadAheadPlayback','Presentation',''); playReadAheadPresentation(); } function pauseReadAheadPresentation(){ $('#read_ahead_player_pause_play').each(function(){ $(this).find('.fa-pause').removeClass('fa-pause').addClass('fa-play'); $(this).off('click'); $(this).attr('onclick','resumeReadAheadPlayback()'); }); logReadAheadPlayerAction('pauseReadAheadPresentation','Presentation',''); read_ahead_pause(); } function endReadAheadPresentation(){ $('.fa-play').removeClass('fa-play').addClass('fa-repeat'); $('.fa-pause').removeClass('fa-pause').addClass('fa-repeat'); $('#read_ahead_player_pause_play').each(function(){ $(this).off('click'); $(this).attr('onclick','restartReadAheadPresentation()'); }); logReadAheadPlayerAction('endReadAheadPresentation','Presentation',''); logLTIEndPresentation(); } function playReadAheadPresentation(){ autoPlay=true; currentPosition--; logReadAheadPlayerAction('playReadAheadPresentation','Presentation',''); nextReadAheadPresentationItem(); } function startReadAheadStepper(timeDisplayWord){ clearInterval(readAheadPlayerTimer); readAheadPlayerTimer = setTimeout(function() { read_ahead_step(); },timeDisplayWord); } function stopReadAheadStepper(){ clearInterval(readAheadPlayerTimer); } function read_ahead_step(){ if (autoPlay) { nextReadAheadPresentationItem(); } } function read_ahead_pause(){ autoPlay=false; stopReadAheadStepper(); } function showReadAheadPresentationItem(index){ currentPosition = index; currentPresentationItem = presentation[currentPosition] != undefined ? presentation[currentPosition].trim() : ""; if (currentPresentationItem != "") { currentItemWordCount = presentation[currentPosition].replace("\n","").split(" ").length; if (currentPresentationItem.startsWith("")){ startReadAheadStepper(currentItemWordCount*timePerWord); $('#read_ahead_player_field').html('
'+currentPresentationItem+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Word',currentPresentationItem); } else { startReadAheadStepper(currentItemWordCount*timePerPhraseWord); $('#read_ahead_player_field').html('
'+currentPresentationItem.replace("\n","
")+'
'); logReadAheadPlayerAction('showReadAheadPresentationItem','Phrase',''); } } else { if (currentPosition < totalPositions) { nextReadAheadPresentationItem(); } else { endReadAheadPresentation(); read_ahead_minimize(); } } currentReadAheadControls(); updateReadAheadSliderPosition(); saveReadAheadPosition(); } function priorReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('priorReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition-1); } function nextReadAheadPresentationItem(){ stopReadAheadStepper(); logReadAheadPlayerAction('nextReadAheadPresentationItem','Controls',''); showReadAheadPresentationItem(currentPosition+1); } function read_ahead_playAgain(){ currentWordIndex = 0; logReadAheadPlayerAction('read_ahead_playAgain','Controls',''); playReadAheadPresentation(); } function read_ahead_minimize(){ setMinimized = true; logReadAheadPlayerAction('read_ahead_minimize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_maximize(){ setMinimized = false; logReadAheadPlayerAction('read_ahead_maximize','Controls',''); read_ahead_switch_min_max(); } function read_ahead_switch_min_max(forceSwitch){ forceSwitch = forceSwitch != undefined ? forceSwitch : false; if (forceSwitch) { setMinimized = !setMinimized; } if (setMinimized) { $('#read_ahead_player_back').fadeOut(); $('#read_ahead_player').addClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-lg').addClass('fa-sm'); $('.player-icons .fa-minus').removeClass('fa-minus').addClass('fa-expand'); logReadAheadPlayerAction('read_ahead_switch_min_max','Min',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_maximize()'); //}); } else { $('#read_ahead_player_back').fadeIn(); $('#read_ahead_player').removeClass('minimize'); $('.player-icons .fa-stack').removeClass('fa-sm').addClass('fa-lg'); $('.player-icons .fa-expand').removeClass('fa-expand').addClass('fa-minus'); logReadAheadPlayerAction('read_ahead_switch_min_max','Max',''); //$('#read_ahead_player_max_min').each(function(){ // $(this).off('click'); // $(this).attr('onclick','read_ahead_minimize()'); //}); } } function saveReadAheadPosition(){ $.ajax({ type:'POST', url:'/ajax/save_user_presentation_position.php', data: { 'id':747, 'position': currentPosition } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); } function logLTIEndPresentation(action) { if (!logToLTI) { return; } $.ajax({ type:'POST', url:'/lti/presentationEnded.php', data: { 'documentId':747, 'userId':0, } }) } function logReadAheadPlayerAction(action,area,details){ var d = new Date(); var t = d.getTime(); action = action != undefined ? action.trim() : 'UNKNOWN'; area = area != undefined ? area.trim() : ''; details = details != undefined ? details : ''; // If we are about to show a new word, increase the number of keywords // reinforced so we can log that for the Dashboard page. if (area == 'Word') { window.keywordCount++; } $.ajax({ type:'POST', url:'/logging/logPlayerAction.php', data: { 'documentId':747, 'userId':0, 'playerAction':action, 'playerArea':area, 'details':details, 'timestamp': t } }) .done(function(results){ }) .fail(function( jqXHR, textStatus ) { alert( "Request failed: " + textStatus ); }); }