Effacer les filtres
Effacer les filtres

Help applying band pass filter to frequency domain data

2 vues (au cours des 30 derniers jours)
Faisal
Faisal le 1 Mar 2011
I have data in a matrix M (4500 x 3).
  • 1st column (frequency values ranging 4-10 GHz)
  • 2nd column (magnitude)
  • 3rd column (phase)
I want to perform two tasks:
1) apply following band pass filter on this frequency domain data.
G = sin(a)/a*sin(n/N) ;
a = t*(f-fc)
Where
N = Total number of discrete frequencies
n = frequency sample index
t = gate width in time domain (1-4 ns)
f = frequency in GHz
fc = central frequency in GHz
2) how to convert this frequency domain data into time domain data what i believe is that presently values of column 2 and column 3 are in frequency domain. Do i simple write this to convert into time domain
output = ifft(M)
I read matlab documents but could not find method to define this filter.

Réponse acceptée

Paulo Silva
Paulo Silva le 1 Mar 2011
%make some test data
f=4e9+5e9*rand(4500,1);
m=rand(4500,1);
ph=rand(4500,1);
data=[f m ph];
fc=5e9; %cut frequency
t=4e-9; %width
N=4500; %number of samples
a=t*(data(:,1)-fc); %???? what to call the a values?!
G=zeros(4500,1); %preallocate the memory for the filter
%get the values of the filter for each sample
for idx=1:4500
G(idx)=sin(a(idx))/a(idx)*sin(idx/N);
end
FilteredMag=G.*data(:,2); %Apply the filter to the magnitude of the signal
I have no idea what the time values are because I don't know Fs (the sampling frequency).
  1 commentaire
Faisal
Faisal le 2 Mar 2011
Dear paulo.....thnx a lot. it helped me really

Connectez-vous pour commenter.

Plus de réponses (1)

jks
jks le 12 Mai 2011
hell paulo and faisal, I want to perform time domain gating (filtering).
I have frequency domain data as a) frequency b) magnitude c) phase I have converted it to time domain and distance domain. I want to perform following:
1) In time domain or distance domain i want to filter some data points.
2) plot the converted data points in frequency domain
frequency range 30MHz to 190MHz total data points is 401 sampling frequency =400KHz
I want to filter the data in few nano sec range in time domain.
my codes and data values are as :
clc
angle =degree ; %calling phase angel
amp = 10.^(RL/20); % converting reflection loss from dB to linear
radian = angle*pi/180; % converting theta to radian
RLCF = amp.*exp(1i*radian); % combining the real and imaginary part
z=abs(RLCF);
figure(1);
plot(freq,z);% frequency domain plot
title ('frequency domain plot');
xlabel('frequency');
ylabel('reflection loss(linear magnitude)');
%-----------------time domain conversion--------------
N =length(RL);
f1 = 30e6;% starting frequency
f2 = 190e6;% final frequency
deltaF = (f2-f1)/(N-1); % sampling frequency
dt = 1/(deltaF*(N-1));% sampling time
t = dt*(0:N-1); % total time
RLCT =ifft(RLCF,N);% inverse of frequency domain data of reflectin loss
RLCT1=real(RLCT);
RLT = 20*log10(RLCT);% dB conversion of reflectionloss data in time domain
figure(2);
plot(t,RLT);
title ('Time Domain Plot');
ylabel('Reflection Loss (dB)');
xlabel('Time');
axis([0 2.55500000000000e-07 -70 0]);
%---------------------Distance to fault----------
c = 3e8;
D = c.*t/2;
figure(3);
plot(D,RLT)%distance to fault plot
title('Distance to Fault')
xlabel('Distance')
ylabel('Reflection Loss (dB)');
axis([0 36 -70 0]);}
freq 30000000 30400000 30800000 31200000 31600000 32000000 32400000 32800000 33200000 33600000 34000000 34400000 34800000 35200000 35600000 36000000 36400000 36800000 37200000 37600000 38000000 38400000 38800000 39200000 39600000 40000000 40400000 40800000 41200000 41600000 42000000 42400000 42800000 43200000 43600000 44000000 44400000 44800000 45200000 45600000 46000000 46400000 46800000 47200000 47600000 48000000 48400000 48800000 49200000 49600000 50000000 50400000 50800000 51200000 51600000 52000000 52400000 52800000 53200000 53600000 54000000 54400000 54800000 55200000 55600000 56000000 56400000 56800000 57200000 57600000 58000000 58400000 58800000 59200000 59600000 60000000 60400000 60800000 61200000 61600000 62000000 62400000 62800000 63200000 63600000 64000000 64400000 64800000 65200000 65600000 66000000 66400000 66800000 67200000 67600000 68000000 68400000 68800000 69200000 69600000 70000000 70400000 70800000 71200000 71600000 72000000 72400000 72800000 73200000 73600000 74000000 74400000 74800000 75200000 75600000 76000000 76400000 76800000 77200000 77600000 78000000 78400000 78800000 79200000 79600000 80000000 80400000 80800000 81200000 81600000 82000000 82400000 82800000 83200000 83600000 84000000 84400000 84800000 85200000 85600000 86000000 86400000 86800000 87200000 87600000 88000000 88400000 88800000 89200000 89600000 90000000 90400000 90800000 91200000 91600000 92000000 92400000 92800000 93200000 93600000 94000000 94400000 94800000 95200000 95600000 96000000 96400000 96800000 97200000 97600000 98000000 98400000 98800000 99200000 99600000 100000000 100400000 100800000 101200000 101600000 102000000 102400000 102800000 103200000 103600000 104000000 104400000 104800000 105200000 105600000 106000000 106400000 106800000 107200000 107600000 108000000 108400000 108800000 109200000 109600000 110000000 110400000 110800000 111200000 111600000 112000000 112400000 112800000 113200000 113600000 114000000 114400000 114800000 115200000 115600000 116000000 116400000 116800000 117200000 117600000 118000000 118400000 118800000 119200000 119600000 120000000 120400000 120800000 121200000 121600000 122000000 122400000 122800000 123200000 123600000 124000000 124400000 124800000 125200000 125600000 126000000 126400000 126800000 127200000 127600000 128000000 128400000 128800000 129200000 129600000 130000000 130400000 130800000 131200000 131600000 132000000 132400000 132800000 133200000 133600000 134000000 134400000 134800000 135200000 135600000 136000000 136400000 136800000 137200000 137600000 138000000 138400000 138800000 139200000 139600000 140000000 140400000 140800000 141200000 141600000 142000000 142400000 142800000 143200000 143600000 144000000 144400000 144800000 145200000 145600000 146000000 146400000 146800000 147200000 147600000 148000000 148400000 148800000 149200000 149600000 150000000 150400000 150800000 151200000 151600000 152000000 152400000 152800000 153200000 153600000 154000000 154400000 154800000 155200000 155600000 156000000 156400000 156800000 157200000 157600000 158000000 158400000 158800000 159200000 159600000 160000000 160400000 160800000 161200000 161600000 162000000 162400000 162800000 163200000 163600000 164000000 164400000 164800000 165200000 165600000 166000000 166400000 166800000 167200000 167600000 168000000 168400000 168800000 169200000 169600000 170000000 170400000 170800000 171200000 171600000 172000000 172400000 172800000 173200000 173600000 174000000 174400000 174800000 175200000 175600000 176000000 176400000 176800000 177200000 177600000 178000000 178400000 178800000 179200000 179600000 180000000 180400000 180800000 181200000 181600000 182000000 182400000 182800000 183200000 183600000 184000000 184400000 184800000 185200000 185600000 186000000 186400000 186800000 187200000 187600000 188000000 188400000 188800000 189200000 189600000 190000000
RL -3.98535156000000 -3.96417236000000 -3.94549561000000 -3.92755127000000 -3.90228271000000 -3.87292480000000 -3.84912109000000 -3.80999756000000 -3.76660156000000 -3.72717285000000 -3.68121338000000 -3.64660645000000 -3.61718750000000 -3.59173584000000 -3.57702637000000 -3.57708740000000 -3.58660889000000 -3.60552979000000 -3.63787842000000 -3.68670654000000 -3.74829102000000 -3.82122803000000 -3.88940430000000 -3.95764160000000 -4.01135254000000 -4.05429077000000 -4.07369995000000 -4.06317139000000 -4.02642822000000 -3.96496582000000 -3.89746094000000 -3.80352783000000 -3.71978760000000 -3.63787842000000 -3.57421875000000 -3.52990723000000 -3.50036621000000 -3.49707031000000 -3.51354980000000 -3.55297852000000 -3.61407471000000 -3.68804932000000 -3.77459717000000 -3.86145020000000 -3.95562744000000 -4.04687500000000 -4.12283325000000 -4.17752075000000 -4.21087646000000 -4.21575928000000 -4.19030762000000 -4.13629150000000 -4.06924438000000 -3.99407959000000 -3.92224121000000 -3.84686279000000 -3.80230713000000 -3.77557373000000 -3.76977539000000 -3.79071045000000 -3.83056641000000 -3.89031982000000 -3.95623779000000 -4.03762817000000 -4.12667847000000 -4.21054077000000 -4.27166748000000 -4.33685303000000 -4.37860107000000 -4.40182495000000 -4.40136719000000 -4.36962891000000 -4.32257080000000 -4.26098633000000 -4.19961548000000 -4.13586426000000 -4.08618164000000 -4.04888916000000 -4.04049683000000 -4.04959106000000 -4.07843018000000 -4.13244629000000 -4.20318604000000 -4.28161621000000 -4.36264038000000 -4.44281006000000 -4.51464844000000 -4.56829834000000 -4.61062622000000 -4.62252808000000 -4.60830688000000 -4.58056641000000 -4.52111816000000 -4.46499634000000 -4.39160156000000 -4.32336426000000 -4.26232910000000 -4.22082520000000 -4.19622803000000 -4.18377686000000 -4.07489014000000 -4.27374268000000 -4.35134888000000 -4.44778442000000 -4.55813599000000 -4.65969849000000 -4.75225830000000 -4.66699219000000 -4.92578125000000 -4.96783447000000 -4.97988892000000 -4.94415283000000 -4.89685059000000 -4.82821655000000 -4.73950195000000 -4.63796997000000 -4.54379272000000 -4.41653442000000 -4.25494385000000 -4.37487793000000 -4.38861084000000 -4.42028809000000 -4.47195435000000 -4.55068970000000 -4.64202881000000 -4.76831055000000 -4.89303589000000 -5.01950073000000 -5.12648010000000 -5.20410156000000 -5.22843933000000 -5.17301941000000 -5.13598633000000 -5.22380066000000 -5.18547058000000 -5.10324097000000 -5.01519775000000 -4.91921997000000 -4.84072876000000 -4.78024292000000 -4.72805786000000 -4.70803833000000 -4.71459961000000 -4.75512695000000 -4.81564331000000 -4.89447021000000 -4.99514771000000 -5.09101868000000 -5.20443726000000 -5.45176697000000 -5.63630676000000 -5.73196411000000 -5.77158737000000 -5.76259613000000 -5.70712280000000 -5.62490845000000 -5.52018738000000 -5.40951538000000 -5.29924011000000 -5.19575500000000 -5.10905457000000 -5.04158020000000 -5.00122070000000 -4.97384644000000 -4.97030640000000 -4.99337769000000 -5.05268860000000 -5.22445679000000 -5.42048645000000 -5.59162903000000 -5.75135040000000 -5.90334511000000 -6.03680420000000 -6.13598633000000 -6.20062256000000 -6.21112061000000 -6.18322754000000 -6.11877441000000 -6.04254150000000 -5.93754196000000 -5.83168411000000 -5.73035431000000 -5.63799286000000 -5.55194855000000 -5.48606873000000 -5.46562195000000 -5.50970459000000 -5.60354614000000 -5.66735077000000 -5.73854065000000 -5.81319809000000 -5.91458702000000 -6.01704407000000 -6.12585449000000 -6.24511719000000 -6.34600830000000 -6.43591309000000 -6.50408936000000 -6.53948975000000 -6.56927490000000 -6.56311035000000 -6.54034424000000 -6.51312256000000 -6.46160889000000 -6.42980957000000 -6.42700195000000 -6.44226074000000 -6.44281006000000 -6.40997314000000 -6.37542725000000 -6.35125732000000 -6.32946777000000 -6.31994629000000 -6.31768799000000 -6.35040283000000 -6.35314941000000 -6.39160156000000 -6.43798828000000 -6.51135254000000 -6.51251221000000 -6.63720703000000 -6.72497559000000 -6.81176758000000 -6.89318848000000 -6.97534180000000 -7.05328369000000 -7.10614014000000 -7.14505005000000 -7.15344238000000 -7.11303711000000 -7.05752563000000 -6.98443604000000 -6.89990234000000 -6.82543945000000 -6.75933838000000 -6.72460938000000 -6.57513428000000 -6.56622314000000 -6.60052490000000 -6.65985107000000 -6.75689697000000 -6.88598633000000 -7.04867554000000 -7.24612427000000 -7.45025635000000 -7.66903687000000 -7.87744141000000 -8.04475403000000 -8.07240295000000 -8.07867432000000 -8.00845337000000 -7.86627197000000 -7.68582153000000 -7.48147583000000 -7.27206421000000 -7.07653809000000 -6.89428711000000 -6.74731445000000 -6.64245605000000 -6.58972168000000 -6.58514404000000 -6.63891602000000 -6.78393555000000 -7.01696777000000 -7.30722046000000 -7.65878296000000 -8.08581543000000 -8.55437469000000 -9.03283691000000 -9.40863037000000 -9.62493896000000 -9.64569092000000 -9.50878906000000 -9.22473145000000 -8.85158920000000 -8.41979980000000 -7.99871826000000 -7.58084106000000 -7.20336914000000 -6.93273926000000 -6.73779297000000 -6.59936523000000 -6.54425049000000 -6.56402588000000 -6.66168213000000 -6.85516357000000 -7.14175415000000 -7.53225708000000 -8.03274536000000 -8.62055206000000 -9.26159668000000 -9.87860107000000 -10.4218140000000 -10.7756348000000 -10.8461304000000 -10.6577454000000 -10.2520752000000 -9.71716309000000 -9.13189697000000 -8.57627106000000 -8.08517456000000 -7.67407227000000 -7.35223389000000 -7.11654663000000 -6.97290039000000 -6.91052246000000 -6.94451904000000 -7.06164551000000 -7.27426147000000 -7.58978271000000 -8.00250244000000 -8.50782776000000 -9.08349609000000 -9.73065186000000 -10.3994141000000 -11.0162048000000 -11.4691315000000 -11.6195984000000 -11.4557953000000 -11.0255432000000 -10.4513855000000 -9.84802246000000 -9.27526855000000 -8.78208542000000 -8.37271118000000 -8.06466675000000 -7.84100342000000 -7.70755005000000 -7.65335083000000 -7.68991089000000 -7.80187988000000 -8.01339722000000 -8.31298828000000 -8.70764160000000 -9.17816162000000 -9.70477295000000 -10.2854004000000 -10.8831177000000 -11.4221039000000 -11.8043671000000 -11.9422073000000 -11.8034897000000 -11.4448090000000 -10.9633484000000 -10.4341431000000 -9.92858887000000 -9.49029541000000 -9.11187744000000 -8.80869293000000 -8.56768799000000 -8.40345764000000 -8.31242371000000 -8.31747437000000 -8.39178467000000 -8.55923462000000 -8.80026245000000 -9.11505127000000 -9.51837158000000 -9.99804688000000 -10.5622253000000 -11.1788483000000 -11.8150444000000 -12.3815308000000 -12.7708130000000 -12.9186401000000 -12.7988892000000 -12.4495850000000 -11.9636383000000 -11.4247437000000 -10.8703613000000 -10.3531494000000 -9.89996338000000 -9.52960205000000 -9.23223877000000 -9.00089645000000 -8.84980774000000 -8.78096771000000 -8.76757813000000 -8.83103561000000 -8.96916580000000 -9.18841553000000 -9.52471924000000 -9.90881348000000 -10.4709778000000 -11.0825500000000 -11.7611618000000 -12.4815674000000 -13.1994934000000 -13.7532349000000 -14.0146484000000 -13.9681396000000 -13.6024780000000 -13.0363159000000 -12.3792725000000 -11.7098999000000 -11.0887299000000 -10.5546875000000 -10.0506287000000 -9.67034912000000 -9.35583496000000 -9.14385986000000
degree -24.4711914000000 -34.3242188000000 -53.1220703000000 -72.1542969000000 -91.2636719000000 -110.357422000000 -129.304688000000 -148.027344000000 166.460938000000 175.500000000000 157.871094000000 140.574219000000 123.669922000000 107.052734000000 90.7109375000000 74.5664063000000 58.4472656000000 42.3486328000000 26.1005859000000 9.71923828000000 -6.94641113000000 -24.0004883000000 -41.4736328000000 -59.3701172000000 -77.7226562000000 -96.5097656000000 -115.656250000000 -135.007812000000 -154.449219000000 -173.769531000000 167.125000000000 148.390625000000 130.101562000000 112.283203000000 94.9375000000000 78.0253906000000 61.4667969000000 45.2236328000000 29.1914063000000 13.2590332000000 -2.68377686000000 -18.6713867000000 -34.8662109000000 -51.3222656000000 -68.1406250000000 -85.3769531000000 -103.066406000000 -121.226562000000 -139.769531000000 -158.667969000000 -177.781250000000 163.003906000000 143.878906000000 124.925781000000 106.253906000000 87.9433594000000 70.0273438000000 52.5078125000000 35.3476562000000 18.4663086000000 1.83132935000000 -14.6362305000000 -31.0200195000000 -47.3857422000000 -63.8515625000000 -80.4277344000000 -97.2128906000000 -114.208984000000 -131.480469000000 -148.972656000000 -166.746094000000 175.312500000000 157.199219000000 139.019531000000 120.773437000000 102.562500000000 84.4355469000000 66.4062500000000 48.5195313000000 30.7534180000000 13.1303711000000 -4.37573242000000 -21.7617188000000 -39.0859375000000 -56.3759766000000 -73.6152344000000 -90.8632813000000 -108.107422000000 -125.376953000000 -142.648438000000 -159.910156000000 -177.160156000000 165.636719000000 148.453125000000 131.261719000000 114.109375000000 96.9433594000000 79.7656250000000 62.5449219000000 45.2783203000000 27.9658203000000 9.98632813000000 -7.64550781000000 -25.4819336000000 -43.4492188000000 -61.5429688000000 -79.6894531000000 -97.8378906000000 -117.001953000000 -134.875000000000 -152.742188000000 -170.484375000000 172.058594000000 154.839844000000 137.906250000000 121.246094000000 104.800781000000 88.5781250000000 71.0742188000000 54.5146484000000 38.2265625000000 21.6289063000000 4.71618652000000 -12.4821777000000 -30.0737305000000 -47.9873047000000 -66.2792969000000 -84.8515625000000 -103.603516000000 -122.447266000000 -141.226563000000 -159.976563000000 -179.406250000000 162.542969000000 145.316406000000 128.394531000000 111.783203000000 95.4980469000000 79.4414063000000 63.5546875000000 47.7343750000000 31.8447266000000 15.7905273000000 -0.519989014000000 -17.1865234000000 -34.2919922000000 -51.9072266000000 -70.2050781000000 -89.5585938000000 -109.083984000000 -128.183594000000 -147.488281000000 -166.835938000000 174.042969000000 155.312500000000 137.066406000000 119.396484000000 102.261719000000 85.6816406000000 69.5019531000000 53.6708984000000 38.0351563000000 22.5166016000000 7.01611328000000 -8.66577148000000 -24.7011719000000 -41.4287109000000 -58.4941406000000 -75.5195313000000 -93.0175781000000 -111.173828000000 -129.878906000000 -149.019531000000 -168.488281000000 171.957031000000 152.496094000000 133.335938000000 114.587891000000 96.3476563000000 78.6347656000000 61.4501953000000 44.7089844000000 28.3564453000000 12.2319336000000 -3.79168701000000 -19.9282227000000 -35.9824219000000 -51.7480469000000 -67.6074219000000 -83.8242188000000 -100.392578000000 -117.406250000000 -134.820313000000 -152.667969000000 -170.886719000000 170.558594000000 151.781250000000 132.886719000000 113.988281000000 95.1738281000000 76.5605469000000 58.2060547000000 40.1142578000000 22.2734375000000 4.67089844000000 -12.6943359000000 -29.5532227000000 -46.0419922000000 -62.3808594000000 -78.7421875000000 -95.1582031000000 -111.667969000000 -128.250000000000 -144.996094000000 -162.007813000000 -178.968750000000 163.726563000000 146.210937000000 128.539062000000 110.582031000000 92.4414063000000 74.2246094000000 55.9052734000000 37.5097656000000 19.1079102000000 0.812835693000000 -16.9726563000000 -34.9814453000000 -52.3837891000000 -69.5664063000000 -86.5605469000000 -103.316406000000 -119.941406000000 -136.363281000000 -152.648438000000 -168.710937000000 175.492188000000 158.574219000000 142.023438000000 125.332031000000 108.375000000000 91.1015625000000 73.3906250000000 55.2910156000000 36.7373047000000 17.7846680000000 -1.38085938000000 -20.4433594000000 -39.5273437000000 -58.7626953000000 -77.4257813000000 -95.7285156000000 -113.439453000000 -130.597656000000 -147.187500000000 -163.269531000000 -178.921875000000 165.765625000000 150.695313000000 135.675781000000 120.632813000000 105.380859000000 89.6601563000000 73.7988281000000 57.3994141000000 40.2519531000000 22.2500000000000 3.36584473000000 -16.3457031000000 -36.7304688000000 -57.8837891000000 -79.4140625000000 -100.822266000000 -121.472656000000 -141.042969000000 -159.386719000000 -176.550781000000 167.320313000000 151.687500000000 136.683594000000 122.308594000000 108.279297000000 94.4667969000000 80.6328125000000 66.6816406000000 52.4570312000000 37.7919922000000 22.5385742000000 6.50805664000000 -10.4599609000000 -28.5625000000000 -48.2138672000000 -69.6933594000000 -92.7656250000000 -116.759766000000 -140.707031000000 -163.371094000000 175.785156000000 156.738281000000 139.273438000000 123.105469000000 107.908203000000 93.4902344000000 79.6367188000000 66.1406250000000 52.8398438000000 39.5742188000000 26.1655273000000 12.5224609000000 -1.58532715000000 -16.2373047000000 -31.6831055000000 -48.2919922000000 -66.4667969000000 -86.4140625000000 -108.246094000000 -131.738281000000 -156.164063000000 179.699219000000 156.828125000000 135.792969000000 116.660156000000 99.1601562000000 82.9707031000000 67.8203125000000 53.4296875000000 39.5781250000000 26.0424805000000 12.7341309000000 -0.584030151000000 -14.0539551000000 -27.8710938000000 -42.1767578000000 -57.0449219000000 -72.7285156000000 -89.5527344000000 -107.863281000000 -127.851563000000 -149.519531000000 -172.535156000000 163.750000000000 140.371094000000 118.078125000000 97.4179688000000 78.3984375000000 60.8652344000000 44.5615234000000 29.3178711000000 14.8037109000000 0.830734253000000 -12.9038086000000 -26.5478516000000 -40.1376953000000 -53.8359375000000 -67.7031250000000 -81.9199219000000 -96.6679687000000 -112.148438000000 -128.593750000000 -146.246094000000 -165.242187000000 174.296875000000 152.402344000000 129.332031000000 105.740234000000 82.4843750000000 60.3378906000000 39.7128906000000 20.6801758000000 3.01104736000000 -13.6086426000000 -29.3603516000000 -44.3984375000000 -58.8935547000000 -73.0449219000000 -86.9453125000000 -100.742187000000 -114.474609000000 -128.351563000000 -142.453125000000 -157.003906000000 -171.730469000000 172.414062000000 156.042969000000 139.144531000000 120.835938000000 101.109375000000 79.8847656000000 57.9667969000000 34.0683594000000 10.4016113000000 -12.6911621000000 -34.4628906000000 -54.4628906000000 -72.8847656000000 -89.9824219000000 -105.892578000000 -120.849609000000 -135.281250000000 -149.218750000000 -162.898437000000
please help
  1 commentaire
Walter Roberson
Walter Roberson le 12 Mai 2011
Please start a new Question for this topic.

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by