I use the defination of PSD to calculate the PSD expression of cos, however, the result is different with the result computed by matlab function! Please give the difference expaination,thank you very much. The figure and code are attacted !
This the result, and the code is below,
clear
L=200;
deltax=0.01;
fs=1/deltax;
x = 0:deltax:L;
y = cos(x);
nfft=2*round(numel(x)/4);
%---pwelch
[px2,fx2]=pwelch(y,hanning(nfft),nfft/2,nfft,fs);
umin=0;
umax=1e3;
u=umin:deltax:umax;
psd_temp=(2*sin(L/2)*cos(pi*L*u)-4*pi*u*cos(L/2).*sin(pi*L*u))./(1-4*pi^2*u.^2);
psd_temp=psd_temp.^2/L;
figure
loglog(u,psd_temp)
hold on
loglog(fx2,px2,'r')
legend({'Analytical by defination','Numerical result by matlab function'})
set(gca,'fontsize',12)
figsize_only(12,10)
However, in the analytical solution, the denominator will be zero when u equals 1/2/pi, Can any body give explaination from math view?
Aparna Sathya Murthy
Dear Aparna Sathya Murthy ,
I also tried the psd function in matlab which uses the fft to calculate the PSD, the result is the same with pwelch()
When I decreace the interval of u in the analytical expression of PSD for finite length,I got strange figure!
Code belw:
L=1000;
deltax=0.0001;
fs=1/deltax;%---------sample frequency
nfft=2*round(numel(x)/4);%-------fft num
%---psd
[px,fx]=psd(y,nfft,fs,hanning(nfft),nfft/2);
px=px/fs*2;
px([1,end])=px([1,end])/2;
%---plot
loglog(fx,px);
legend('psd','pwelch')
title('psd与pwelch method by matlab')
plot(fx,px);
plot(fx2,px2)
For finite length PSD analytical solution, can I use the Window function to make the head and taile of the sample length zeros?
Hi, I've N2 gas cylinder and 100 ppm NH3 gas cylinder. With these two cylinders, I'd like to make a ppb level (1- 100) concentration. Any idea how to do that?
01 February 2021 3,264 2 View
Hi, I am doing RNA extraction for my final year project. After extraction of RNA by using conventional method, I did quantification and qualification of RNA by using Nanodrop spec and gel...
11 January 2021 8,775 10 View
Hey guys, I always have problems with the attachment of HEK293t cells to glass coverslips while doing IFA. They are so easy to detach from the coverslips while washing. The coverslips are already...
30 December 2020 8,381 3 View
Animals were fed DSS via drinking water and fecal samples were collected and DNA was isolated using Qiagen stool DNA isolation kit. The V4 region of extracted DNA was amplified with specific...
20 December 2020 1,739 3 View
Does anyone know any glass slides (thickness 0.1 to 1mm) that have very low autofluoresence (GFP). I am doing a very sensitive experiment that require my glass substrate to be as low fluoresence...
28 November 2020 1,917 6 View
In Northern blot, we normally use either 2*SSC+0.1% SDS or 0.1*SSC+0.1% SDS in washing step. Does anyone know what's the function of the SDS in the washing buffer? Thank you in advance
26 November 2020 2,432 1 View
Suppose an agricultural field with uniform soil texture and salinization. The groundwater depth is 20 meters, assuming that the depth of the groundwater and the concentration of salts remain...
25 November 2020 2,382 4 View
Recently I have been involved in this problem: After expressed by adding IPTG, lysed with B-PER, and resolved with Buffer B (8M urea), incubate with Ni-NTA beads, everything looks fine. When I...
21 November 2020 7,416 3 View
Hello, I am trying to set up an in vivo recording system in mice brain. Which company do you recommend? Neuralynx? TDT? NeuroNexus? Which one do you guys use and why? Please let me know. Thank you!
12 November 2020 2,508 1 View
I am working on a droplet based digital biosensing project. Assume I have some droplets (size 30-40um in diameter), each droplet contians aroun 10-20 Nano beads (100-300nm in diamter). The surface...
28 October 2020 5,761 7 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 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 required to learn about Flyback converters and I got stuck not knowing to full design of the power supply flyback converter Based USB Charger Model using Simulink, especially the design model...
25 February 2021 5,435 2 View
I do need the Matlab code of Fractal Discrete Cosine Transform (FDCT). Can anyone who has already implement this code, help me with the implementation of this transform?
24 February 2021 5,602 2 View
Hi Hope you are well. Can you please share your code for D2D implementation in Matlab. I want to implement D2D in Matlab based Vienna simulator and struggling to deploy D2D. Thanks
24 February 2021 9,378 3 View
Dear colleagues If anyone has a model of multi-effect distillation in EES or MATLAB software, please send it to me.
24 February 2021 7,282 1 View
Hi, I am a third year chemistry undergrad doing my group project in which I need to predict the HPLC retention time of 20 aromatic molecules. to do this we require the chemical properties of these...
24 February 2021 1,384 3 View
I use Matlab 2014b to capture some images with a PointGrey camera connected with USB3 port. I initialize the camera in a function which basically execute these followed lines : vid =...
22 February 2021 6,386 1 View
How to build fouling and erosion simulation model for Aero Engine compressor and turbine rotor in Simulink / Matlab?
22 February 2021 3,697 1 View