Hi , I am reopening this issue as I have not still overcome or understood the problem.
Let me first describe my application I have to collected data (type short, wirefmt sc16) at a particular center frequency at a sampling rate of 25 Msps and set the bandwidth to be 20 MHz and the master clock is set to be 25 MHz. I have a custom fpga to detect the presence of unwanted signal within the 20 MHz bw of data collected . I assumed that when I give the option --bw 20 MHz , only that data will be received and sent to ddc will be within that 20 MHz bw and any tone or signal beyond that will be discarded. But when I used the script ./rx_samples_to_file I noticed that the data collected is equal to the sample rate specified and when plotted using pwelch function with bin size 512 I still see the tone after 20 MHz bw. /usr/lib/uhd/examples/rx_samples_to_file --file /dev/test_5bw_20msps_1 --subdev A:A --args="type=e3x0,master_clock_rate=25e6" --bw 20e6 --freq 110e6 --rate 25e6 --duration 1 --stats as per input parameter specified above I set the centre frequency at 110 MHz and have injected a tone at 122.5 MHz and set the BW to be 20 MHz. I assumed the tone should not be visible , but unfortunately it does. This may lead to faulty detection in my application. 1. I added debug statements to see if at all the bw setting code is executed and it does. 2. I varied the bandwidth to be 5 MHz and I am able to see the roll off and also the tone. Please find the plot below for the above input command [image: Inline image 1] Now setting the bandwidth to 5 MHz for verification purpose[image: Inline image 2] The code snippet used to plot the data in matlab as follows binary_file = '\\fargo\projects\wls\staging\subbuku-o\test_5bw_20msps_1';%./rx_samples_to_file --file /dev/test_5bw_20msps_2 --subdev A:B --args="type=e3x0,master_clock_rate=50e6" --bw 20e6 --freq 110e6 --rate 25e6 --duration 1 --stats if ~exist('plotOn', 'var') || isempty(plotOn) plotOn = 1; end if ~exist('power_dbm', 'var') || isempty(power_dbm) power_dbm = -100; end fid = fopen(binary_file,'r'); %A = fread(fid,inf,'bit16','ieee-le'); if ~exist('wordWidth','var') || isempty(wordWidth) % default to 16 bits... A = fread(fid,inf,'bit16','ieee-le'); else % extract according to word desired word width width = ['bit',num2str(wordWidth)]; A = fread(fid,inf,width,'ieee-le'); end %A = fread(fid,inf,'bit16','ieee-le'); %A = fread(fid,inf,'float32'); %parse the entire binary file %A = fread(fid); fclose(fid); %A = A(1:2*4096); I = A(1:2:end); %figure; plot(I,'b-'); %-->counter test Q = A(2:2:end); if 0 figure; mag = 20*log10(abs(I)); plot(faxis,mag(1:N)); end complex_sig = I + 1i*Q; %complex_sig = transpose(complex_sig); %fs = 1024e3;%512e3; %1024kHz for 4x and 8x; 768kHz, 512kHz and 256kHz for 6x, 2x and 1x %fs = 512e3; %fs = 256e3; %fs = 7.68e6; %fs = 15.36e6; %fs = 7.68e6; fs =25e6; %[Pxx,F] = pwelch(complex_sig(1:4096*15),4096,[],[],fs,'centered');%%4x and 8x %[Pxx,F] = pwelch(complex_sig(1:end),[],[],fs,'centered');%%4x and 8x [Pxx,F] = pwelch(complex_sig(1:end),512,[],[],fs,'centered');%%4x and 8x if plotOn figure; plot(F,10*log10((Pxx)),'b-'); grid on title(binary_file) if exist('title_str','var') if ~isempty(title_str) title(title_str) end end end Please let me know if it is possible to resolve the issue to eliminating the tone beyond 20 MHz bandwidth for 25 Msps sampling rate Thanks and Regards, Olivani Subbukutty 571-331-2481
_______________________________________________ USRP-users mailing list USRP-users@lists.ettus.com http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com