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.

Rectangular Power Spectral Density

Status
Not open for further replies.

sib

Junior Member level 1
Joined
Nov 15, 2010
Messages
15
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,375
Hello guys
does can anyone give me an idea about the signal which will give us a power spectral density of the shape of a rectangle spanning 5MHz and centered around 10MHz. i want to construct such a signal, some say that it would be a sinc pulse that can give a rectangular PSD , any suggestions

thanks
 

Hi sib,

That signal can be obtained filtering a "white" noise with a passband filter whose frequency response has the shape of a rectangle spanning 5MHz and centered around 10MHz.
In the above, "white" does not mean rigorously white: it is enough that in that band (7.5 to 12.5 MHz) the power spectral density be uniform.
Regards

Z
 

thanks zorro,

so you suggest i take the fft of a randn vector and then multiply it with filter=[0 0 0 0 0 1 1 1 1 0 0 0 0 0 0] sort of vector with 1s placed at the write place, am i right.
 

so you suggest i take the fft of a randn vector and then multiply it with filter=[0 0 0 0 0 1 1 1 1 0 0 0 0 0 0] sort of vector with 1s placed at the write place, am i right.
That could be a method. It that way (operating in frequency domain) the fft's could be too long if you need a long vector. Note that after multiplication you shold go back to time domain with ifft, and that the vector you are telling should have two "1...1" parts, symmetrically placed if you want a real signal as result. Obviousy, the problem of long vectors can be solved, but it is not too evident.
A time-domain approach is to design a suitable filter and then filter with it the random vector (convolve it with the impulse response of the filter). This would be the "natural" method; the other can be seen as a way to implement the solution in frequency domain.
Are you usng matlab?
regards

Z
 

yes i am using matlab, was checking out the filter functions of matlab, i guess they wont help much in this case since they are FIR and irr types.
 

yes i am using matlab, was checking out the filter functions of matlab, i guess they wont help much in this case since they are FIR and irr types.
Why not? You can synthesize the transfer function you want.
You just need to take care about the stabilization time of the filters (border effects).
Regards
Z
 
Last edited:
  • Like
Reactions: sib

    sib

    Points: 2
    Helpful Answer Positive Rating
%SPECIAL NOISE FILTER

clc;
clear;
close all;
Fs=6000;
Ts=1/Fs;
t=[0:1:10000-1];
x= randn(1,length(t));
plot(t,x);
title('Random Noise')
xlabel('Time (sec)')
ylabel('Amplitude')
grid on

nfft= 2^nextpow2(length(x));
fft_noise= fft(x,nfft)/length(x);
f_axis= Fs* linspace(0,1,nfft);
figure(2)
plot(f_axis,abs(fft_noise));
title('FFT of Random Noise')
xlabel('Frequency (Hz)')
ylabel('Amplitude')
grid on


filter=[zeros(1,length(fft_noise))];
center_fwidth= 200;
facto= length(f_axis)/Fs;
c_freq=300;
fpoints= round2even(center_fwidth*length(f_axis)/Fs);
plcae= round(c_freq*facto);
filterp1=[zeros(1,plcae-fpoints/2), ones(1,fpoints)];
filterp2= [ zeros(1,(length(fft_noise)-2*length(filterp1))), ones(1,fpoints),zeros(1,plcae-fpoints/2)];
filter=[filterp1, filterp2];
pro=fft_noise.*filter;
figure(3)
plot(f_axis,abs(pro));
title('Filter TF * signal in Frequency Domain')
xlabel('Frequency (Hz)')
ylabel('Amplitude')
grid on
figure(4);
infft=2^nextpow2(pro);
Y1=ifft(pro,infft)/length(pro);
plot(t,Y1(1:length(t)));
title('IFFT of the filtered signal')
xlabel('time (sec)')
ylabel('Amplitude')
grid on


%convert back and check the data
nfft2=2^nextpow2(Y1);
Y2=fft(Y1,nfft2)/length(Y1);
fe=linspace(0,1,nfft2) * Fs;
figure(5);
plot(fe,Y2);
title('Fourier transform of the filtered signal')
xlabel('Frequency (Hz)')
ylabel('Amplitude')
grid on

---------- Post added at 15:22 ---------- Previous post was at 15:22 ----------

i figured it would be nice to have the code for others too. if its ok
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top