Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

matlab coding for bandpass filter

Status
Not open for further replies.

divylmu

Newbie level 4
Joined
Aug 24, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,314
I need to design a band pass filter, then create a white gaussian signal of 1024 samples. After that I need to filter that signal x(t). I have to den cross correlate the output and the white gaussian noise y(t). I have to get the frequency response of x(t) and y(t)

can any one help me please..

clc;
clear all;
n=input('Enter the order of the Filter:');
for l = 0:n-1;
end
b = fir1(l,[0.35 0.65]);
freqz(b,1,512)
figure(1),
x=randn (1024,1);
figure(2),plot(x);
xlabel('x')
ylabel('x[n]')
grid
y=filter(1,b,x);
figure (3);
xlabel('output')
ylabel('y')
plot(y)
c=xcorr(x,y);
figure(4),
plot(c)
d=freqz(b,x,y)
figure (5);
 

I would assume you have an input ->filter->add noise->filter->correlate ?

your noise has to be awgn i.e. you want to use a awgn (b,snr)or otherwise
otherwise you can try as follows:
SNR = 10^(SNR/10);
variance = 1/(2*1*SNR);
x = x+sqrt(variance)*randn(input_length); (awgn)

you can filter this and then use xcorr.
 

My tutor asked me to design a bandpass filter first using fir1 function. Then to create a noise signal of 1024 samples using ramen function.after this he wanted me to filter the noise signal using filter function. Now I am supposed to assume that the channel is unknown. So, I need to cross correlate the noise and output to get the transfer function . Lastly need to obtain the frequency response of the filtered signal and also the frequency response of the transfer function obtained from cross correlation
 

Your "SUPPOSED" to find the unknown function. So the randn function creates a normal distributed sequence. But that is not your filter coefficients (so you are not modelling the noise in the system instead your using the noise variable as filter coefficients). You want to correlate the output and input and then obtain the transfer function of the channel i.e. essentially you will get a variable proportional to the noise model and SNR.
 

Yeah you are correct. So now what should I do. Can you please help me with the coding. Please
 

take the same steps as I mentioned in my previous post.
There a couple of good books 1.) Digital Communication Proakis 2.) Communication Systems Simon haykin 3.) Digital Comm Techniques Simon, Hinedi and Lindsey are some good references.

Your can also look at some digital communication tutorials. like **broken link removed**, will be a good start.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top