Skip to content

Moved!

Dear all,

I just moved to my another static blog of my own. Visit http://aurabindo.in

Advertisements

NAOT – some python implementations

Who doesnt get bored after doing the same thing again and again? I had the same feeling while attending the class on Numerical Analysis & Optimization Techniques. We were being taught some simple methods to find root of an equation, which requires doing some tedious calculations again and again. So i though i`ll give that boring task to python. Now for the home works, just put your function and run it – voila! It will save you atleast 20 minutes! Well, but not if you`re an Einstein 😛

See below for some limited python implementations of Regula – Falsi Method, and Netwon – Raphson Method. They are not 100% tested – but they seem to work correct with the few examples i tried. You need to  have python installed for this code to work.

http://bit.ly/w4zfDk  –    regula_falsi-method.py
http://bit.ly/xQ3KX0  –    newton_raphson-method.py

The function whose roots you need to find out is given as a function in the code. So for solving your own functions, just edit the line starting with:

def eqn:

return (put your function here)

By the way, learn some python first! 😛

Make Your Own Processor

Designing a processor by your own is definitely not an easy job. But with the power
of Open Source, it is simplified. Its about Open Source Hardware (called OSH hereon). You
know very well about open softwares – basically, you get them for free and you’re free to
distribute. OSH doesn’t mean that you get the hardware for free – you will have to pay for
its production cost. But you get the design files for free; and you’re free to edit and
distribute. This is exactly opposite to what the embedded systems giant ARM does. They sell
their design, not their product. Almost 70% of ARM`s revenue is from the royalty and
licensing for their Intellectual Property rights.

OpenRISC is an open source processor architecture maintained at opencores.org.
RISC stands for Reduced Instruction Set Computer. It is designed specifically for small
devices, like a mobile, or a tablet. The more powerful desktop processors in your home are
called Complex Instruction Set Computers (CISC). By the way, ‘architecture’ is the internal
design of a processor. Even though the internals of a processor is an electronic circuit
consisting of a lot of transistors and other stuff, it is designed using programming
languages. The most popular ones are Verilog and VHDL. OpenRISC is written in Verilog.
Another open processor is the OpenSPARC, developed by Sun Microsystems. Your 32-bit
Intel processor’s architecture is called ‘x86’ and the standard 64-bit systems are called ‘x64′.
The first name is misleading. The number ’86’ shows the dominance of Intel in desktop
processor market. It reminds of the classic 8086 architecture made by Intel. Infact, the
reason why AMD survived is just because it used the same instruction set that the Intel
processors have so that any software made for Intel processors will work on AMD too.

OpenRISC was on the news when Linux kernel 3.1 was released as the new kernel will
support OpenRISC. That means you can run a linux OS on an OpenRISC based processor. So
how are you going to make you own processor when the fabrication process will cost you
crores? The answer is an FPGA ( Field Programmable Gate Array). It is a device that we can
program using any hardware description language (Verilog, etc). Good ones cost around Rs
50k. But you can get cheaper ones for around 5k. So learn some HDL and make the
OpenRISC processor. And if you’re a byte more crazy, make some modifications and create
your own processor!!!

GSM vs CDMA

What choice would you make, if someone shoots you with this question: GSM (Global System for Mobiles) or CDMA (Code Division Multiple Access)? That’s definitely not a big question for anyone of us. Almost everyone in India prefers a GSM service. But do you know that in the US, over 80% people still use CDMA service? However, GSM has about 5.2 billion subscribers globally and CDMA has just about 575 million. So what makes CDMA so “outstanding” :-)? This technology was developed during the World War II by the US Army, for secure data transmission. But it became commercial only in 1995 (Hong Kong). However, the commercial CDMA technology is patented by Qualcomm. This is one reason for its less global popularity. But GSM was commercial since 1980`s and is a pretty mature standard. GSM is a specification of an entire wireless network infrastructure, while CDMA relates only to the air interface — the radio portion of the technology.

Technically, GSM uses the method called Time Division Multiple Access (TDMA). That means, each user is given a specific amount of time to talk, which is of the order of some microseconds or so. To put it simple, say there are 10 users in a cell. In TDMA, user1 is given a small portion of time to talk, while all the other users stay idle. Then chance goes to user2 and then for user3. When all the 10 users complete talking one round, chance again goes to user1. But you don’t feel the discontinuity, as the idle time is too small to be felt by our ears. GSM is now a mature technology that became commercial in the 1980`s.

CDMA is a “spread spectrum” technology, allowing many users to occupy the same time and frequency allocations in a given band/space. CDMA (Code Division Multiple Access) assigns unique codes to each communication to differentiate it from others in the same spectrum. In a world of finite spectrum resources, CDMA enables many more people to share the airwaves at the same time than do alternative technologies. The CDMA air interface is used in both 2G and 3G networks. 2G CDMA are branded cdmaOne and include IS-95A and IS-95B. CDMA is the foundation for 3G services: the two dominant IMT-2000 standards, CDMA2000 and WCDMA, are based on CDMA.

Power Consumption:

There is accumulating evidence that cellphones that operate on GSM networks emit significantly more radiation than do cellphones operating on CDMA networks. This is not apparent when you look at a phone’s specs, because phone manufacturers are required to list only the “Specific Absorption Rate” (SAR) — the measure of the rate at which energy from a radio frequency electromagnetic field is absorbed by the body — of a phone at its maximum radiation output. Several recent studies have shown that CDMA phones normally emit a small fraction of their maximum radiation output, while GSM phones emit, on average, half the maximum. This comes down to the different radio frequency bands that the two networks operate on and the distance from a base station.

Quality of Service:

CDMA is said to possess more call quality, as it uses a frequency hopping method, which gives full available bandwidth to the call, unlike TDMA in GSM, which splits the available bandwidth so as to accommodate more users. Moreover, data transfer speeds are higher in CDMA than GSM. Comparatively, calls are connected fast in CDMA than GSM. Most of us have the misconception that 3G is something specific to GSM. But it’s not the case. It just stand for “Third Generation”. As defined by the International Telecommunications Union (ITU), CDMA2000, CDMA2000 1xEV-DO, WCDMA/UMTS and HSDPA/HSUPA are 3G technologies. One point to note is that, “WCDMA/UTMS” is actually used in GSM phones. But, as the name suggests, WCDMA, is basically a modification of the CDMA technique.

International Roaming:

The major problem with CDMA is its limited roaming facilities. GSM wins here. So if you often go abroad, it’s better to go for GSM. If coverage is your main concern, then CDMA is worth considering. For the minimum signal reception to make a call, you can be twice as far from a base station in CMDA, as compared to GSM. This will help if you are in some rural areas. Another disadvantage accused with CDMA was its inability to switch the operators. But this problem is now solved with OMH (Open Market Handset). If your phone has an OMH certification, you can switch between the operators by changing the Removable User Identity Module or R-UIMs (analogous to SIM), which is provided by the operator. Overall call rates are generally lower for CDMA networks.

The Verdict:

If you are an SMS junkie, CDMA is definitely not for you 😦 It’s because, the message encoding algorithms are not 100% compatible with those in the GSM network. So if you send any message between GSM and CDMA phone, you will end up receiving a lengthy message (above 160 characters) as individual messages, rather than combined as a single message. But if you make calls rather than SMS, you should consider CDMA for its good call quality, signal reception and lower call costs.

Wifi-Direct

Wi-Fi Direct (a.k.a. Bluetooth Killer) devices can connect in a way that makes it more simple and convenient than ever for users to print, share, sync and display. Wi-Fi Direct devices can connect directly to one another without access to a traditional network, so mobile phones, cameras, printers, PCs, and gaming devices can connect to each other directly to transfer content and share applications anytime and anywhere. Devices can make a one-to-one connection, or a group of several devices can connect simultaneously. They can connect for a single exchange, or they can retain the memory of the connection and link together each time they are in proximity. This makes it much more smarter choice as the need for a device that acts as a hotspot, is eliminated, unlike the traditional Wi-Fi devices.

Wi-Fi Direct device connections can happen anywhere, anytime – even when you don’t have access to a Wi-Fi network. Your Wi-Fi Direct device will signal to other devices in the area that it can make a connection. You can view available devices and ask them to connect, or you might receive an invitation to connect to another Wi-Fi Direct device. When two or more Wi-Fi Direct-certified devices connect directly, they have formed a Wi-Fi Direct Group, using Wi-Fi Protected Setup and the latest Wi-Fi security(WPA2). Now you can get started doing all the exciting things that Wi-Fi Direct enables!
Operation in managed Wi-Fi environments (e.g. enterprise, hotspots, etc.) was an important consideration in the creation of the P2P Specification. To promote efficient use of wireless bandwidth, Wi-Fi Direct devices do not use 802.11b rates (1, 2, 5.5, or 11 Mbps) for data or management frames (barring Probe Request frames sent to both Wi-Fi Direct devices and Legacy Devices), nor shall they respond to requests indicating support only for 802.11b rates. This decreases the air time consumed by signaling between Wi-Fi Direct devices.

A WLAN Access Point may implement capabilities that allow it to manage Wi-Fi Direct devices, enabling robust protection and isolation of the enterprise infrastructure network. A WLAN AP with this capability may deauthenticate any Wi-Fi Direct device from the infrastructure network for out-of-policy behavior and communicate the reason for that action. For example, in an environment where controlled access to infrastructure network resources requires each device to authenticate, a P2P-enabled WLAN AP may communicate to all client devices that Cross-connection is not allowed. All Wi-Fi Direct devices are required to comply with this policy.

Wi-Fi has already changed the way the world connects. With Wi-Fi Direct, users will now find it even easier to share, show, print, and synchronize content however they want, wherever they are. With the next generation of Wi-Fi Direct devices, users will no longer need to think about connecting to the network because they are already carrying the network with them!

Camera Based Line Follower

Me and some of my friends planned to do something for the techfest of IIT, Kharagpur – Techkriti’11.

We`ve narrowed to a line follower. The event was like a racing. Go through all the checkpoints. We`ve decided to use a camera to find then path. My team mate, Arvind had a mini-ATX form factor motherboard. We`ve decided to hook it up to our robo. You can do a line follower with only a microcontroller. In that case, mostly, the path shall be found out by using IR sensors. But, as we were using camera, we needed a computer, because it`s a tedious process to interface a camera to a microcontroller. Moreover, we may need more processing power.

We planned to boot a small linux distribution from pendrive so that interfacing the camera is “piece of cake”…:-)

The image processing was taken care by the OpenCV library for C. Initially we planned to control the speed of the DC motor used ( for taking curves) by creating a Pulse Width Modulation circuit using 555. But as the circuit became too large, we decided to use a microcontroller. We used Atmega16.

Bass freak

Yes, I`m a bass freak. Melodious songs with clear soft bass-lines soothes me….Rock songs with powerful bass shoots me !

Just like everyone else, I admire the music maestro AR Rahman. “Munbe Vaa” is a beautiful song. It remained my favorite. For quite a long time. But when i played this song in my aiwa nsxf958 , a mini-hifi audio system, i was disappointed…coz the beautiful beats we used to hear from TV speakers does not come out exactly from the Woofers….It`s not exactly bass. However, if those beats were less than some 60 or 70 Hz, i mean, if it came from a woofer, it would have spoiled it`s beauty.

But, as i told you, I`m a bass freak — It not the justice for me. So decided to give it an extra punch.