Saturday, October 27, 2012

Matlab code for convolution Decoder


clear all;
close all;
f=input('Enter the number of fliflops:');
x=input('Enter the number of outputs:');
trellis=struct('numInputSymbols',2,'numOutputSymbols',4,'numStates',4,'nextStates',[0 2;0 2;1 3;1 3],'outputs',[0 3;3 0;2 1;1 2]);
n=input('Enter the number of messages:')

Channel Capacity code in c


#include<stdio.h>
#include<conio.h>
include<math.h>
void main()
{
int i,j,k,1,m,n,x,y,cim,row;
float sumr,sume,cs,p;

BCH decoding in Matlab


clear all;
clc;
n=input('accept n=');
k=input('accept k=');
m=input('message bit=');
msg=gf([m]);
c=bchenc(msg,n,k);

decoded=bchdec(c,n,k)

BCH encoding in Matlab


clear all; clc;
n=input('accept n=');
k=input('accept k=');
m=input('message bit=');
msg=gf([m]);
c=bchenc(msg,n,k)

Friday, October 26, 2012

99 Ways to Make Your Computer Blazingly Fast


There are probably a lot of great tweaks and performance hacks that I’ve missed here, so feel free to chime in with comments! Enjoy!
1. Defragment your computer hard disk using free tools like SmartDefrag.

Thursday, October 25, 2012

Matlab code for Spatial Domain Filtering


clc;
clear all;
close all;
a=imread('pout.tif');
figure;
imshow(a);
title('Original Image');
b=im2double(a);

Matlab Code for Pseudo Colouring


clc;
clear all;
close all;
a= imread('cameraman.tif');
[row col]=size(a);
for x=1:1:row
    for y=1:1:col

Matlab Code for OPENING - Erosion after Dilation


%opening

clear all
clc
a=imread('circbw.tif');
p=size(a);


%%% Writing program
w=[1 1 1;1 1 1;1 1 1];
for x=2:1:p(1)-1
    for y=2:1:p(2)-1

Matlab Code for Image filtering from Gaussian Noise using Median and Wiener filter


clc;
clear all;
I= imread('liftingbody.png');
I2=imnoise(I,'gaussian');
subplot(2,2,1);

Matlab Code for Logarithm Transformation


%Logarithm

a=imread('cameraman.tif');
subplot(1,2,1);
imshow(a);
b=im2double(a);
[m,n]=size(a);
for i=1:m-1
for j=1:n-1
r=b(i,j);
c(i,j)=log(1+r);
end;
end;
subplot(1,2,2);
imshow(a);

Matlab Code For DCT-IDCT


i=imread('cameraman.tif');
[r c]=size(i);
ID=double(i);
if(r==c)
    N=c;

Matlab Code For Histogram Equalization


% Histogram Equalization
clc; clear all;

img = imread('rice.png');
 if(size(img,3) > 1)
    img = rgb2gray(img);
end;

Matlab Code For Power Law Transformation


%Power law

a=imread('cameraman.tif');
subplot(1,2,1);
imshow(a);
[m,n]=size(a);
for i=1:m-1
for j=1:n-1
s(i,j)=a(i,j).^4;
end;
end;
subplot(1,2,2);
imshow(a);

Matlab code for Negative Transformation


%Negative transformation

a=imread('cameraman.tif');
subplot(1,2,1);
imshow(a);
[m,n]=size(a);
for i=1:m-1
for j=1:n-1
s(i,j)=256-1-a(i,j);
end;
end;
subplot(1,2,2);
imshow(a);

Matlab Code for Edge Detection Robert, Prewitt, Sobel


%%%% EDGE Detection

clc;
close all;
clear all;
a=imread('C:\Documents and Settings\student\Desktop\lenna1.bmp');

Matlab code for Dilation and Erosion


%dialation and erosion

clear all
clc
a=imread('circbw.tif');
p=size(a);

%%% using in built MATLAB function %%%

Matlab code for Closing - Erosion after Dilation


%closeing

clear all
clc
a=imread('circbw.tif');
p=size(a);

%%% using in built MATLAB function %%%

C code for determining the statistical Properties of Image


/*Statistical Properties of Image*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>

C code for Smoothing Filter


/* Smooth Filter */

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<math.h>

C code for sharpening filter


/* Sharp Filter */

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<math.h>

C code for Histogram


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<stdlib.h>
#include<math.h>

C code for Grey Level Transformation


/*Gray Level Transformation*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>
#include<math.h>

C code for Bit Map


/*BMP Attributes.C*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<graphics.h>

typedef struct bmp_header {
unsigned char ft[2];
unsigned long fsz;