Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dynamic Ringtone Adjustment using On Demand Sampling on Android Smartphones Casey O’Leary – Washington State University CURENT REU Mentor: Yong Li Project.

Similar presentations


Presentation on theme: "Dynamic Ringtone Adjustment using On Demand Sampling on Android Smartphones Casey O’Leary – Washington State University CURENT REU Mentor: Yong Li Project."— Presentation transcript:

1 Dynamic Ringtone Adjustment using On Demand Sampling on Android Smartphones Casey O’Leary – Washington State University CURENT REU Mentor: Yong Li Project Manager: Dr. Wei Gao 7/17/2014 Knoxville, Tennessee

2 Overview 2 GoalAlgorithmSource Code IntegrationTestingFuture Work

3 Goals of Research Implement current method of sampling and adjusting in the Android Kernel Adjust the current method to implement demand sampling (done) Improve upon current method using frequency analysis (future work) Originally created and developed by Christopher Daffron and Alex Hoppe 3

4 Algorithm for Sampling and Processing Frequency and Intensity Categorized Contrasting ringtone selectedVolume set based on Intensity level Calculating Frequency and Intensity Weighted Average FrequencyAverage Intensity Fast Fourier Transform Simplicity vs. SpeedPrinceton CS Library On Demand Sampling 500 millisecond audio sampleRaw audio data stored in WAV file 4

5 Frequency and Intensity Calculations Weighted average frequency – calculated by takes the summation of intensity at each frequency multiplied by the frequency and then divide that by the summation of all frequency intensity values for(int i = 0; i < transformData.length/2; i++) { numVals++; rawSum = rawSum+ transformData[i].abs(); sum = sum + transformData[i].abs()*I; } avgVal = sum / rawSum; Average Intensity – calculated by taking the average value of the absolute value of all of the samples for(int i = 0; i < channel1Data.length; i++) { sum = sum + Math.abs(channel1Data[i]); counter++; } avIntensity = sum / counter; 5

6 Ringtone and Intensity Thresholds Frequency Thresholds Intensity Thresholds 6 2000 Hz Cat 1 < -> 3 3300 Hz Cat 2 < -> 4 4500 Hz Cat 3 < -> 5 6000 Hz Cat 4 < -> 4 6000 Hz < X Cat 5 -> 1 <.012 Stream 0 <.030 Stream 1 <.048 Stream 2 <.067 Stream 3 <.085 Stream 4 <.103 Stream 5 <.14 Stream 6.14 < X Stream 7 (Max)

7 Reasoning for Thresholds Device specific – Using LG Nexus 4 Microphone samples audio at 44,100Hz.5s provides 22,000 samples Different phone may need adjustment 7

8 Source Code Integration Overview of Android Architecture 8

9 Source Code Integration Incoming Call -> Broadcast Message Telephony Service broadcast receive Abstract layer between phone application and radio hardware Message is then handled in the CallNotifier class Contains instance of Ringer class Controls when the Ringer is played Ringer.ring() Function Called by CallNotifier class Modifications placed within this function Executed only before first ring using ring counter 9

10 Source Code Integration Audio Sampling Audio buffer Created Start recording thread 500 ms delay using SystemClock static methods Recording thread stopped Processing Raw audio data put into WAV file Fast Fourier Transform applied producing complex data Frequency and Intensity Algorithms applied Average Frequency and Intensity set and categorized Series of Logic statements and switch statements set ringtone and volume Call UI displayed and ringing starts 10

11 Testing 11

12 Testing 12

13 Testing Algorithm Run Time About 150-200ms longer than on Ringtone Selector Application 13 Total Runtime of Algorithm for each sample (ms)Sample 35301B 36252B 36503B 36304B 35665B 36481C 35352C 35093C 35374C 35265C 36441D 35532D 36513D 37004D 37065D 35471E 35872E 35823E 36444E 36175E 38091F 36292F 37263F 36574F 37625F 38091G 36992G 42803G 45034G 44145G 3709.166667 Average Runtime (ms)

14 Conclusion and Future Work Algorithm Optimization Average runtime of about 3.5 seconds Eliminate unnecessary complexity or looping Use multi-threading strategy to process data Noise Reduction using Signal Processing Techniques Identify any unwanted “noisy” frequencies to get a more accurate representation of environment Data Processing via Cloud Computing Use a cloud, such as Amazon EC2, to perform necessary data processing Need to consider wireless signal strength and speed to determine if this method would be efficient 14

15 Questions? 15


Download ppt "Dynamic Ringtone Adjustment using On Demand Sampling on Android Smartphones Casey O’Leary – Washington State University CURENT REU Mentor: Yong Li Project."

Similar presentations


Ads by Google