Monday, October 17, 2011

Use Automator to play song everyday morning

I wake up everyday to alarm sound that's pretty boring. Well I could download an interesting sound and have it as alarm sound. I was wondering if there is a way to fire up a job on my new mac. I searched online and found a very nice way to do it. Mac has a tool called "Automator". If you can't find where it is, just use search on the right top corner. I wanted to play "Suprabhatam" everyday morning as my alarm sound. I found a youtube video that has it. I am not very good at scripting (to be honest I dont know anything on Mac). So I used Automator to create a workflow. Here are the steps:
- Open Automator
- From the library, choose Internet
- Get specified URL. This would just get data from the URL and not really open it.
- Specify the URL you want , which is the video link to youtube.
- Click "Display URL" from the options tab. This would open the URL
- Save the workflow

This creates a workflow item that you can click and it would open youtube with the video you specified. Now, we need to find a way to fire it up everyday. iCal with the ability to have a repeat schedule comes handy for that. Here is how you do it:
- open iCal
- schedule a meeting/action at the time you want the video to be played
- chose alarm type to "open file"
- chose the workflow file you created

Thats it. The iCal will fire up the file everyday at the same time and the youtube file will be played. I love it now. I wake up to "Suprabhatam" everyday.
Do let me know if there is a simpler way to do the same, I am interested to know.

Tuesday, October 11, 2011

Using VNC on Mac

Recently I switched my jobs and was given a MacBookPro and a kick-ass ASUS 6-core intel i7 desktop. (sabertooth x58 motherboard). The desktop is so damn powerful that i want to make this the main work PC. The problem so far is, that the email is on Mac and hence the pointers to the documents and all. I dont want to switch between the two PCs (switch keyboards, mouse etc). So I thought why not create remote desktop environment for both.
With that I was easily able to create remote desktop from Mac to PC. Just download the remote desktop software for Mac from Microsoft website and you are pretty much good to go. Make sure you enable remote desktop on the PC. It was straight forward after that.
The other way round was more tedious. First, there is no software that allows remote desktop from Windows to Mac. There is a new company that seems to be still working on that but is not yet ready. I inquired around and no one in my company has done that earlier. The closest that they did is to use VNC. So I decided to give it a try.
Here is the procedure:

  • on Mac, go to "system preferences"
  • Click "sharing"
  • enable the "screen sharing" by checking the box next to it
  • click the "computer settings" and chose a good password to be used by the users who connect via VNC
  • note down the ip address shown in the "screen sharing" pop up
  • go to PC and open your vnc viewer (I used RealVNC client, download from here if you dont have it)
  • When the viewer opens up, click the "options" and chose "color level" as full ; otherwise vnc exits after connecting.
  • enter the server ip address and click ok
  • enter the password you gave on Mac to let the PC connect to Mac
  • At this point you should see what is on Mac on your PC
I hope this is helpful for folks who are new to Mac as I am. I struggled about 2 hours to get a good PC to Mac set up going. The only problem I am encountering now is that the VNC seems to disconnect every so often. Other than that I am harnessing the power to two great machines.




Improved version of mailing from command line using ruby


After I wrote my first mail program, I was not happy with sticking in the recepient's email addr and message in the program. So I modified the program to take recepient's address and the message from command line. The message is terminated by entering a new line with just period (.).
#The following program has been tested with Ruby1.9.1
# Used my Gmail Acct. If not SMTP settings need to change
require 'net/smtp'

puts "Enter the recepient's email id";
toaddr = gets.chomp
puts "Enter message (To terminate enter a new line with .)"
msg = "";
line = gets
until line.chomp.eql? "."
 msg << line;
 line = gets
end

smtp = Net::SMTP.new 'smtp.gmail.com', 587
smtp.enable_starttls

smtp.start(Socket.gethostname,'username','password',:login) do |server|
   smtp.send_message msg, 'fromaddr',toaddr
end

Have fun using it.

Mail from command line using ruby


I always wanted to send a simple mail, like a one liner, to someone but felt it was inefficient to open the email editor, type in everything. So I started off writing a simple script that I can use from command line to kick off the mail to someone.
First since I started reading about Ruby and its powerfulness, thought it would be best to start the script in Ruby. So, I searched internet to find the solutions.
Here is the first solution I found. The first solution mentioned in that link didnt work for me for the same exact reasons those folks mentioned. I had 1.8.6 version of Ruby. I upgraded it to Ruby 1.9.0. Even then it didnt work. It kept giving :
"mail.rb:2:in `require': no such file to load -- smtp_tls (LoadError)  from mail.rb:2:in `
'"

mail.rb being my test program.
After a bit of fiddling with it, i went back to google to try the search. This time I found another thread where they discussed this a little more. Anyway, the issue is 1.9.0doesnt need require  'smtp_tls' statement.


Here is the complete program : I am assuming gmail as the server


require 'net/smtp'

msgstr = "Some msg"

smtp = Net::SMTP.new 'smtp.gmail.com', 587
smtp.enable_starttls

smtp.start(Socket.gethostname,'username','password',:login) do |server|
   smtp.send_message msgstr, 'from', 'to'
end



Hope you like the program

Thursday, September 1, 2011

Using awk to add elements of colum

Awk is a great tool to do manipulations on the data thats more or less structured. I had  a file that had logs from a simulation. I was trying to parse a log from Axi transaction logger and get the bandwidth numbers. For read bandwidth I had to search for ADDR_RD and the required data is in column 22 and column 19. I was planning to write the script in perl, but then remembered awk and wanted to give it a try. I found the script to be much simpler and classy. Here is the script. I am sure this would have taken me atleast 10 lines to write in perl.

/ADDR_RD/ {rd_bw+=$22*2^$19}
/ADDR_WR/ {wr_bw+=$22*2^$19}
END {print "ReadBW =" rd_bw ", WriteBW =" wr_bw}

Lets say we save this file in rd_wr_bw.awk. To use the script type:
awk -f rd_wr_bw.awk <filename to search>

Very simple and elegant. Love it!

Sunday, July 3, 2011

Setting up gvim

I know this post is not directly related to anything embedded or hardware modeling, but I share it here anyway.

I use gvim as my editor most of the times. I was searching for a place where we can easily understand on how to configure gvim. One of the best link I found is this:
http://lglinux.blogspot.com/2007/09/vim-configuration.html

Here are my settings:
" enable the line numbers
set nu

" indenting
set smartindent

"expand tabs
set tabstop=2
set shiftwidth=2
set expandtab
set incsearch


"set the font n size

if has('gui_running')
  set guifont=Lucida_Console:h10
endif



Some very good tips on using gvim are here:
http://www.rayninfo.co.uk/vimtips.html

Sunday, January 16, 2011

My Resume!

To all those folks interested in knowing my background, here is my current resume




Suresh K Devalapalli
15569 Bristol Ridge Terrace
San Diego, CA-92127
Phone: +1 858 651 8106
E-mail: mrdsureshkumar@gmail.com
Keywords
Multimedia, System Architecture, Audio Processing, DSP, MIDI, fixed-point C, embeddedC, firmware,   systemC/TLM, high-level synthesis, catapultC, Virtio, hardware modeling
Highlights:
 -Receipient of 9 patents in the field of HW for music synthesis and 5 pending in audio processing
 -11 Qualstar Awards for being a key contributor on various projects in Qualcomm
 -Five years experience in writing firmware and software
 -Four years experience in multimedia system design and architecture
 -Three years experience in writing systemC/TLM models
 -Experience with high-level synthesis (CatapultC)
 -Strong DSP fundamentals and C coding skills
 -Excellent communication and interpersonal skills

Professional Experience 
Staff Engineer, Graphics Systems Team, Aug 2010 – present
Qualcomm Inc, San Diego, California
Working with the Graphics Systems Team in evaluating the performance of graphics hardware core. Responsibilities include writing systemC/TLM cycle-approximate models, running various benchmarks through them, projecting the performance of the core under various system load. Help designers improve the performance and make the core tolerant to the latency by first showing the improvement using these models.

Staff Engineer, Audio Systems Team, April 2010 – Aug 2010
Qualcomm Inc, San Diego, California
Worked with the audio systems team on various projects. Work included developing, implementing and evaluating new algorithms, designing hardware for higher-performance and low-power, HW modeling using C/C++, perfomance and power analysis. Projects that I worked include:
- Multi-stream Hardware Sample Rate Converter
 Designed a hardware accelerator for sample rate conversion that simultaneously can support resampling of multiple audio streams that can have different channel, input and output frequency requirements. Defined the architecture, the register specification, SW/HW interface and the usage model in the audio system. TLM model was developed to be used in Virtio Platform for early SW driver development. Various novel techniques were implemented to make sure that any CPU in the system can make use of it.
- TLM and Cosimulation models for Audio System
  I was the lead for the HW models development for the HW blocks in the audio system, which include audio interface, low power RAM, AVTimer, MIDI HW, Data Mover, AVSync block etc. Both systemC/TLM models and cosimulation models (Qualcomm’s own APIs) were developed to help SW development and automation of tests.
Mentored two full-time engineers and an intern, helped them learn the HW modeling techniques,systemC/TLM and cosimulation fundamentals.

Senior Engineer, Audio Systems Team, Oct 2007 – April 2010
Qualcomm Inc, San Diego, California
In my role as Senior Engineer, I significantly contributed and lead some of the following projects:
- Design of Low-Power Audio Sub-System
Designed a low-power audio sub-system with a proprietary DSP, low power RAM, integrated audio interface,hardware accelerators and the bus architecture around them so that we could achieve sub 10mA MP3/AAC+ standalone playback power and yet support multiple audio concurrency. Performance analysis of the system under various concurrencies was carried out to prove the design. Lead the HW modeling of Audio sub-system using TLM models to create a virtual platform using Virtio from Synopsys. Virtio platform was critical early SW development.
- Unified Filter Bank Accelerator
MP3, AAC/AAC+, WMA use a similar but different filter banks in their decoding implementation. Unified Filter Bank was created as a single filter bank solution to support all the decoders. Lead the algorithm design, implementation and testing. Used CatapultC to generate the RTL from C-code. This is the first time audio team used high-level synthesis tools and I helped evaluate it.
- MIDI Hardware Accelerator Design
Qualcomm DSP wasn’t powerful enough to handle 128 DLS2.1 compliant MIDI polyphony. To support 128 polyphony, we designed a hardware accelerator. It’s a mini DSP in itself with its microcode running and multiple instances of processing elements (ALUs). Designed the instruction set, defined the register interfaces, wrote the complete C-model of hardware for assisting HW verification, did the performance analysis to make sure we can achieve the intended 128 polyphony. This project lead to 10 patents filings, out of which 9 are accepted.

Engineer, Audio Systems Team, Jan 2005 – Oct 2007
Qualcomm Inc, San Diego, California
As an engineer I focussed on contributions to the team and being a good team player. The projects
I worked on include:
- DLS2.1 and Mobile DLS compliant MIDI Synthesizer
Developed software based MIDI synthesizer in compliance with DLS2.1 and Mobile DLS Standard. MATLAB was used to develop the initial algorithm and was later ported over to fixed-point C code. Helped the firmware and the software teams to implement it on Qualcomm chipset and commercialize the product.
- Audio Playback framework on QDSP5
Designed and implemented a decoder task framework with which we could support any audio decoder on Qualcomm’s QDSP5. Demostrated the functionality on MSM7500 with a wav decoder. ADPCM decoder that followed next was done within a week, all due to the availability of framework.

Interim Engineering Intern, Audio Firmware Team, Jan 2004 – Aug 2004
Qualcomm Inc, San Diego, CA - 92121
- Reverse engineered Yamaha’s SMAF file format and music synthesis algorithm and invented al-
gorithm to produce indistinguishable sounds from Qualcomm’s music synthesis (CMX). These algo-
rithms are filed for patents and are pending.
- Designed and implemented Parametric Audio Equalizer in fixed-point C, ported it to Qualcomm
DSP’s assembly language.

Graduate Student Instructor, EECS Dept, Aug 2002 – Dec 2003
University of Michigan, Ann Arbor, MI - 48105
Teaching assistant for EECS-452 DSP Design Lab course. Responsibilities included teaching how to
do the lab work, helping with the homeworks, and grading the submitted homeworks. Also had to
help with students’ design projects that constitute 50% of their grade.

Software Design Engineer, VoIP Group, July 2001 – July 2002
Texas Instruments Pvt Ltd, Bangalore, India
Responsible for developing the optimized vocoders on the TI DSPs. My projects include:
-G.728 LDCELP on TMS320C55x processor Implemented ITU G.728 speech coding standard on TI’s TMS320C55x processor. Tested for bit-exactness with the reference test vectors, tested for interruptibility, small and large memory models and helped integrate the codec into Telogy Networks Golden Gate software system.
-GSM-FR on TMS320C64x processor Implemented GSM-FR speech coding standard on TI’s TMS320C64x processor. Tested for bit-exactness with the reference test vectors, tested for interruptibility.
-GSM-AMR on TMS320C64x processor Implemented GSM-AMR speech coding standard on TI’s TMS320C64x processor. Tested for bit-exactness with the reference test vectors, tested for interruptibility.


Patents
Kulkarni; Prajakt, Devalapalli; Suresh - “Bandwidth control for retrieval of reference waveforms in an audio device”, October 5, 2010 , U.S. Patent No.7,807,915

Kamath; Nidish Ramachandra, Kulkarni; Prajakt V, Gupta; Samir Kumar, Molloy; Stephen, Devalapalli; Suresh, Alemania; Allister - “Waveform fetch unit for processing audio files”, October 5,
2010 , U.S. U.S. Patent No.7,807,914

Kamath; Nidish Ramachandra, Kulkarni; Prajakt V, Devalapalli; Suresh, Alemania; Allister - “Shared buffer management for processing audio files”, May 25, 2010, U.S Patent No.7,723,601

Devalapalli; Suresh, Kulkarni; Prajakt, Kamath; Nidish Ramachandra - “Efficient identification of sets of audio parameters”, May 18, 2010, U.S. Patent No.7,718,882

Molloy; Stephen, Devalapalli; Suresh, Kamath; Nidish Ramachandra - “Method and device for generating triangular waves ”, March 30, 2010, U.S. Patent No.7,687,703

Devalapalli; Suresh, Kulkarni; Prajakt, Kamath; Nidish Ramachandra - “Musical instrument digital interface hardware instructions ”, March 16, 2010, U.S Patent No.7,678,986

Kamath; Nidish Ramachandra, Kulkarni; Prajakt, Devalapalli; Suresh - “Musical instrument digital interface hardware instruction set ”, February 16, 2010, U.S Patent No.7,663,052

Kamath; Nidish, Choy; Eddie L. T., Kulkarni; Prajakt, Gupta; Samir K, Molloy; Stephen, Devalapalli; Suresh - “Audio processing hardware elements ”, February 16, 2010, U.S Patent No.7,663,051

Kulkarni; Prajakt, Choy; Eddie L. T., Kamath; Nidish Ramachandra, Gupta; Samir K, Molloy; Stephen, Devalapalli; Suresh - “Pipeline techniques for processing musical instrument digital interface (MIDI) files", February 16, 2010, U.S Patent No.7,663,046

Education
Master of Science and Engineering in Electrical Engineering - Systems Sept 2002 – Dec 2004
University of Michigan, Ann Arbor, Michigan
GPA: 8.12/9
Bachelor of Engineering in Electronics and Communications Engineering Sept 1997 – May 2001
Regional Engineering College, Trichy, India
Percentage: 80.5%

Computer Skills
C, C++
Matlab, SytemC/TLM
Perl, Ruby
Windows, Linux