SERVFORU

Periodogram Using Python Script

Periodogram
• Periodogram is the correct name for the
following process*:



• FFT stands for “Fast Fourier Transform”
• The FFT algorithm that can be used to
compute the
part.
• A periodogram is formed after taking the
average magnitude squared of the FFT.


Periodogram: Simple Example

1.n = integer
2.N = array of numbers from 0 to 2^n
3.x = exp(j*2*pi*f*N) + white noise
4.pg = abs(FFT)^2 / n
5.pgs = 10*log10(pg)
 

•Calculates spectrum from Real/Imag
axis, starting at 0 and rotating counter-
clockwise to 2pi (one full revolution)


LIBs NEEDED



Python
matplotlib.pyplot
scipy
numpy


we can plot the periodagram using python using the following script




****************************************************



from pylab import *
import matplotlib.pyplot as plt
n = 512
N = arange(0,n)
x = exp(2j*pi*0.1*N)+normal(0,0.01,n)
pg = abs(fft(x))**2/n
pgs = 10*log10(pg)
plt.plot(pgs)

 plt.show()



**********************************************


 

Solving a Linear Systes of Equations Using python

Solving linear systems of equations is straightforward using the scipy command linalg.solve. This command expects an input matrix and a right-hand-side vector. The solution vector is then computed. An option for entering a symmetrix matrix is offered which can speed up the processing when applicable. As an example, suppose it is desired to solve the following simultaneous equations:
\begin{eqnarray*} x+3y+5z & = & 10\\ 2x+5y+z & = & 8\\ 2x+3y+8z & = & 3\end{eqnarray*}
We could find the solution vector using a matrix inverse:
\[ \left[\begin{array}{c} x\\ y\\ z\end{array}\right]=\left[\begin{array}{ccc} 1 & 3 & 5\\ 2 & 5 & 1\\ 2 & 3 & 8\end{array}\right]^{-1}\left[\begin{array}{c} 10\\ 8\\ 3\end{array}\right]=\frac{1}{25}\left[\begin{array}{c} -232\\ 129\\ 19\end{array}\right]=\left[\begin{array}{c} -9.28\\ 5.16\\ 0.76\end{array}\right].\]
However, it is better to use the linalg.solve command which can be faster and more numerically stable. In this case it however gives the same answer as shown in the following example:
>>> import numpy as np
>>> from scipy import linalg
>>> A = np.array([[1,2],[3,4]])
>>> A
array([[1, 2],
      [3, 4]])
>>> b = np.array([[5],[6]])
>>> b
array([[5],
      [6]])
>>> linalg.inv(A).dot(b) #slow
array([[-4. ],
      [ 4.5]]
>>> A.dot(linalg.inv(A).dot(b))-b #check
array([[  8.88178420e-16],
      [  2.66453526e-15]])
>>> np.linalg.solve(A,b) #fast
array([[-4. ],
      [ 4.5]])
>>> A.dot(np.linalg.solve(A,b))-b #check
array([[ 0.],
      [ 0.]])
 

How to backup your android phone using Ubuntu

Android backup 



  • If not enabled, enable developer mode by tapping Settings > About phone > Build number (7 times)
  • If not enabled, enable USB debugging in Settings > Developer options > USB debugging
  • Execute on your computer
    adb backup -apk -shared -all
This should hopefully create backup.ab with all of your apps, OS, and data. Later, after reflashing with Android (or rooting / unlocking) you will be able to use
adb restore backup.ab
to restore all of your data.
 

How to Install UBUNTU in Android Phone

Installing Ubuntu on a phone

Ubuntu 13.10 Saucy Salamander released with a new smartphone experiance . just try  it out if you have a an androind smartphone 





Instructions for flashing a phone or tablet device with Ubuntu.
After you install Ubuntu for phones, you will have the following functionality:
  1. Shell and core applications
  2. Connection to the GSM network on Galaxy Nexus and Nexus 4
  3. Phone calls and SMS on Galaxy Nexus and Nexus 4
  4. Networking via Wifi
  5. Functional camera, front and back
  6. Device accessible through the Android Developer Bridge tool (adb)



    Now it suppports only for  galaxy nexus and nexus 4 , anyway for the other phones too may be the same , we are checking with each phones ,and as no other applications are not yet available in the store

    Flashing the device

    1. Desktop setup

    The following steps are required on your desktop system in order to flash and communicate with the device.

    Setup the Ubuntu for phones tools PPA

    The PPA has the tools and dependencies to support 12.04 LTS, 12.10, 13.04 and 13.10. Add the Ubuntu for phones PPA by adding the following custom source list entry to your/etc/apt/sources.list file.
    On your computer, press Ctrl+Alt+T to start a terminal.
    sudo add-apt-repository ppa:phablet-team/tools
    
    
    Then do the following:
    sudo apt-get update 
    sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
    

    3.Device unlock

    If the device is already unlocked, skip to Step 4. These steps will wipe all personal data from the device.
    • With the device powered off, power on the device by holding the power button + volume up + volume down.
    • The device will boot into the bootloader.
    • Plug the device into the computer via the USB cable.
    • On your computer, in a terminal, run sudo fastboot oem unlock, on the device screen, accept the terms of unlocking.
    • Boot the device by pressing the power button (pointed by an arrow with Start on the screen).

    Device factory reset

    If you get stuck in a bootloop rebooting the device after unlocking the bootloader, here is what you do:
    • During the bootloop hold the power button + volume up + volume down button simultaneously to get yourself back into fastboot mode or download mode as you were previously.
    • In fastboot mode or downlaod mode, use the volume keys to scroll to Recovery and the power button to select it.
    • In Recovery (Android robot on his back with a red triangle), tap the volume up button and the power button simultaneously which will bring you into stock recovery. Don't hold the buttons, just tap them simultaneously.
    • Also make sure you're holding the correct volume button. Up will be the volume key on the right.
    • Once you're in Recovery, perform a factory reset/data wipe and then reboot your device, you should now be back to the Welcome Screen.

    4.Initial device setup

    Follow these initial steps on your device:
    1. If not booted, boot the device into Android
    2. Enable USB debugging on the device
      • On Ice Cream Sandwich (version 4.0) go to Settings and turn on USB Debugging (Settings > System > Developer options > USB debugging).
      • On Jelly Bean (versions 4.1 and 4.2) you need to enterSettings > About [Phone|Tablet] and tap the Build number 7 times to see the Developer Options.
      • On 4.2.2, (Settings > About) tap on build number 7 times to activate the developer options menu item).
      • On either Android version you must then enable USB debugging via Settings > Developer options > USB debugging. You will also need to accept a host key on the device.
        • On the workstation: adb kill-server; adb start-server
    3. Plug the device into the computer via the USB cable.
      • Depending on the installed Android version, a popup will show up on the device with the host key that needs to be accepted for the device to communicate with the workstation.
      • Note, 'adb devices' should not show the device as 'offline'. If it does, unplug the device, run adb under sudo on the workstation (egsudo adb kill-server; sudo adb start-server), then plug the device back in.
    4. Save the version of the current image on the device, if on Android, to use as a reference to revert back to. The version can be found by going to Settings > About Phone > Build Number.

    5.Downloading and deploying image to device

    1. To install Ubuntu for phones on your device, you will need to run the command:
      phablet-flash ubuntu-system --no-backup
      Please note, this will wipe the contents of the device so ensure you have made a backup.
      This will deploy the latest build onto your device, after which your device will boot into the Ubuntu Unity shell. This step can take a very long time.

 
 
Support : Ebin EPhrem | Ebin Ephrem | #Gabbarism
Copyright © 2011. Services | Embedded Support | Reviews | Virtual Technologys - All Rights Reserved
Template Created by ebinephrem.com Published by Ebin Ephrem
Proudly powered by Blogger