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.

help me in matlab code ...

Status
Not open for further replies.

vjfaisal

Full Member level 4
Joined
Sep 24, 2006
Messages
205
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
pakistan
Activity points
2,701
hi

i m cofused in some Question as in previous post , yet not cleared....
i m posting some of my results(pics) of the above code , plz try download it and try to explain me from these ........

1) first the original signal in text form ,i read it in matlab
2) The FFt of the origial signal ( This gives a complex plane)
3) why we need Absolute of the FFT .

Q1. please see in pic , that taking absolute gives us replica after the samples of 240 (half) . what does this means......
Q2. after taking absolute, we take magnitude? what difference could be analyse in both these? please explain it complete.

Q3: also tell what is the difference between in N samples ( 512, 4096,e.t.c),
and n , in filtertering for.e.g [n,wn,beta,type]=kaiserord(fc,a,dev,Fs), and 'n' in the above example.

please help me in these question, detailed........

best regard

Added after 3 minutes:

here is my_results attached..........
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
Which previous post?

Your code and attachments are missing.
 

vjfaisal

Full Member level 4
Joined
Sep 24, 2006
Messages
205
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
pakistan
Activity points
2,701
Hi , here is code

code:
N = 512;
dt = 1/fs; %sampling time
T = 1;
t = 0:dt:1;
y=textread('......txt');
Y = fft(y,N);
Pyy = 2*abs(Y) / min(N,T/dt);
mag1 = 20*log10(abs(Pyy));
f = 1/dt*(0:N/2)/N;
figure(1);
plot(y)

figure(2);
plot(f,mag1(1:N/2+1));

For attachements the link is:


please also give me the concept of why frequency domain plots in -fs/2 to fs/2 or 0 to fs/2 range....

regards
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
Cross-posting gets confusing and isn't allowed on EDAboard. Please stay in your original discussion:
 

helios

Full Member level 2
Joined
Jun 3, 2005
Messages
147
Helped
22
Reputation
44
Reaction score
10
Trophy points
1,298
Activity points
2,800
As u know the FFT results in a complex domain values...and the real part is the magnitude of the frequency spectrum and the imag part is the phase diffrence..

so while ploting the FFT ..u dont need the imag part...so taking a (abs) gives the magnitude part of the freq spectrum...and u use the Log transform to enhance the results for visually better plot.


hope it might have cleared u r doubts...
 

vjfaisal

Full Member level 4
Joined
Sep 24, 2006
Messages
205
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
pakistan
Activity points
2,701
Re: help me in these Questions ...

hi
i have following question related to FIlters, if anyone knows ,please help me....

Q1: WHy and How the concept of Extremal Frequencies Arise in optimal (Equiripple) technique, as there is no such concepts in Windows and frequency response technique ??

Q2:
What is remez exchange algorithm ( used in Equiripple technique) basics or FOrmula or End results ??

Q3: Are all the FIR filters (kaiser , Equiripple e.t.c ) are in time domain or frequency domain ??

best regards
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top