i need a MATLAB code of power spectral density PSD with out built in function, i want a code that work with the same as the built in function of periodogram().
Kindly see the code below if its helps:
clear all
%% Define Parameters
% sampling frequency (Hz)
fs=100e6;
% length of time-domain signal
L=30e3;
% desired power specral density (dBm/Hz)
Pd=-100;
% number of FFT points
nfft=2^nextpow2(L);
% frequency plotting vector
f=fs/2*[-1:2/nfft:1-2/nfft];
% create
s=wgn(L,1,Pd+10*log10(fs),1,[],'dBm','complex');
%% Analysis
% analyze spectrum
N=nfft/2+1:nfft;
S=fftshift(fft(s,nfft));
S=abs(S)/sqrt(L*fs);
% time-average for spectrum
Navg=4e2;
b(1:Navg)=1/Navg;
Sa=filtfilt(b,1,S);
% convert to dBm/Hz
S=20*log10(S)+30;
Sa=20*log10(Sa)+30;
%% Plot
figure(1)
clf
plot(f(N)/1e6,S(N))
hold on
plot(f(N)/1e6,Sa(N),'r')
xlabel('Frequency (MHz)')
ylabel('Power Density (dBm/Hz)')
title(['Power Spectral Density'])
legend('Noise Spectrum','Time-Averaged Spectrum')
axis([10e-4 fs/2/1e6 -120 -60])
grid on
hold off
Source: http://www.bitweenie.com/listings/power-spectral-density-matlab/
http://www.bitweenie.com/listings/power-spectral-density-matlab/
Power Spectral Density Estimates Using FFT
Dear, check the following link, may help you:
http://www.mathworks.com/examples/signal/mw/signal-ex08634157-power-spectral-density-estimates-using-fft
Try below code:
note:Fs depends upon data
[k,col]=size(data);
fft_samps = 2^nextpow2(k);
t_fft = fft (data, fft_samps)/k;
Fs=--------;
fprime = Fs/2*linspace(0,1,fft_samps/2);
plot(fprime,2*abs(t_fft(1:fft_samps/2)));
How can i define the USRP N210 on pc under windows 10 and i used gnu radio 3.8.. i set the configuration and i make the ping and recived reply successfuly but i cannot define the device and an...
31 December 2019 7,363 2 View
any one can provide me a mathematical relationship between probability of detection in sensing stage and throughput of SU in interweave sharing in CR in cognitive radio.
09 October 2018 1,903 0 View
iam working on cyclostationary spectrum sensing in cognitive radio, can any one help me to find the MATLAB code or the main procedures to compute pd (probability of detection), ROC curves ?
08 September 2017 4,565 1 View
i have an arduino connected with xbee zigbee, and xbee send data. how can i measured energy consumption of xbee during transmission by using arduino ?
06 July 2016 7,683 9 View
when i want to make an approach to reduce energy consumption in ZIgBee sensor in cognitive radio networks CRN . what is the layer in ZigBee sensor that i must worked in it ? Why ? and can i work...
02 March 2016 7,432 3 View
i need a matlab code of cooperative spectrum sensing in cognitive radio networks using energy detection spectrum sensing technique .
01 February 2016 6,336 2 View
I need to model an anisotropic material in which the Poisson's ratio ν_12 ≠ ν_21 and so on. Therefore, the elastic compliance matrix wouldn't be a symmetric one. In ANSYS APDL, for TB,ANEL...
09 August 2024 5,048 2 View
Request Python code from this article : Gender equity of authorship in pulmonary medicine over the past decade. THANKS!
08 August 2024 6,242 2 View
I am experimenting with cancer and non-cancer cells in a 12-well plate for 4 days with a seeding density 1*10^4/well, however, I noticed that the control group growth rate slows down on D3. Should...
07 August 2024 2,283 2 View
Hi, I'm currently working on a project where I need to plot the atom-projected band structure using GPAW. I've been able to calculate the band structure for my material, but I'm having trouble...
07 August 2024 269 3 View
Visual Studio Code (VS Code) has become a popular choice among developers for several reasons: 1. **Free and Open Source**: VS Code is free to use and open source, making it accessible to...
07 August 2024 7,013 4 View
Hi all, my experimental XPS results shown that my C3N5 sample consists of N-H bond, hence in this case I should incorporate the N-H bond into my DFT modelling. However, I do notice several papers...
07 August 2024 8,414 2 View
I need the python code to forecast what crop production will be in the next decade considering climate and crop production variables as seen in the attached.csv file.
05 August 2024 2,977 3 View
Hello, everyone. I have tried to determine carrier motilities of some materials, by Density Functional Theory, using Quantum ESPRESSO. There are a few methods to do it, like a package called...
04 August 2024 8,894 1 View
I am new to Micromechanics and having similar problem with understanding the implementation of the formula's. I would appreciate if anyone can guide me on how to go about getting a scalar value...
30 July 2024 969 0 View
I would like to calculate the formation energy of P2-Na0.67Fe0.5Mn0.5O2 based on DFT, what should I do step by step. Any help would be appreciated. Thanks.
29 July 2024 8,248 2 View