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,215 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,805 0 View
08 September 2017 4,420 1 View
06 July 2016 7,541 9 View
02 March 2016 7,320 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,224 2 View
I have dataset which shows the length of power lines. I need to classify the lines based on the line length. Is there a rule to classify the High voltage (HV) and low voltage (LV) lines based on...
03 March 2021 4,116 4 View
Hi, Could you help me to get the latest (2019, 2020) solar resource data for a particular site in JAPAN? PV GIS and NSRDB data are not in reach to JAPAN, I'm looking for some other database for...
03 March 2021 961 3 View
Hello all, In SPSS I am going to code 2 open-ended questions. I have already read all the answers and I made a list of the most important categories to which I can code the answers. This question...
02 March 2021 1,757 4 View
Is there a powerful system for the security of the systems distributed on IoT systems?
02 March 2021 3,858 10 View
Dear Researchers I am trying to perform a PIL simulation using STM32F4 Discovery board and comunication serial USB TO TTL. During simulation I receive the following timeout error: An error...
01 March 2021 2,327 1 View
The following code (see 1st 2 images attached) is used to produce PID controller values that are designed to control the system (G). The code finds the PID controller values (noted as k) by using...
28 February 2021 6,560 14 View
I think we were all surprised at the first time we got to know quantum mechanics that the squared modulus of the wave function is the probability density of the existence of the particle? The role...
28 February 2021 6,282 9 View
I have input and output data set for "ANFIS modeling in MATLAB", and I am getting some negative predicted values of output in testing. However, the predicted values of output in training are...
28 February 2021 3,459 3 View
I am working on modeling and simulation of biomecanical material behaviour, I have succeded on simulating skin using anisotropic hyperelastic material, on APDL and in our lab's finite element...
28 February 2021 552 3 View
Dear All, We are using Autodesk cfd to calculate the air flow in a single sided naturally ventilated room, where air flow depends only on buoyancy due to temperature difference between inside and...
25 February 2021 9,602 4 View