Sign in

Not a member? | Forgot your Password?

Search code

Search tips

Free PDF Downloads

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

C++ Tutorial

Introduction of C Programming for DSP Applications

Fixed-Point Arithmetic: An Introduction

Cascaded Integrator-Comb (CIC) Filter Introduction

IIR Filter Design Software

See Also

Embedded SystemsFPGA

DSP Code Sharing > u -Law and Inverse u-Law

u -Law and Inverse u-Law

Language: Scilab

Processor: Not Relevant

Submitted by Senthilkumar R on Mar 24 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

u -Law and Inverse u-Law


The functions u-law and Inverse u law used to perform u-law compression and expansion

function [Cx,Xmax] =  mulaw(x,mu)
  //Non-linear Quantization
  //mulaw: mulaw nonlinear quantization
  //x = input vector
  //Cx = mulaw compressor output
  //Xmax = maximum of input vector x
  Xmax  = max(abs(x));
    Cx = (log(1+mu*abs(x/Xmax))./log(1+mu));
    Cx = x/Xmax;
  Cx = Cx/Xmax; //normalization of output vector

function x =  invmulaw(y,mu)
  //Non-linear Quantization
  //invmulaw: inverse mulaw nonlinear quantization
  //x = output vector
  //y = input vector (using mulaw nonlinear comression)
  x = (((1+mu).^(abs(y))-1)./mu)  
Rate this code snippet:
Rating: 0 | Votes: 0
posted by Senthilkumar R


No comments yet for this code

Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )