calculate snr of digital signal
4 次查看(过去 30 天)
显示 更早的评论
Hi I have a data stream say
data_in
Its maximum is data_max and min is data _min
means that data_in may vry between data_max and data_min
I need to calculate the snr of the data
I am doing it like this
diff=data_max-data_min;
SN=snr(data_in,diff);
Am I correct ??
Regards
Uzmeed
0 个评论
回答(2 个)
Daniel M
2019-11-8
This is not correct. The second input to snr must be a real-valued row or column vector that must have the same dimensions as the first input. It is the estimate of noise of your signal. You are entering a single number which is the range of amplitudes of your signal.
How are you quantifying noise? What does your signal look like? You may want to browse the examples on the document page for snr to see if you can get an estimate of the noise that way. Otherwise, you'll have to provide more information here, perhaps in the form of a figure showing the frequency spectrum of your signal.
1 个评论
Daniel M
2019-11-8
Also, you shouldn't name your variable diff as that overrides the native function diff. This is tricky for new users that don't know common MATLAB function names. If you're ever unsure, you can write
which <name>
where <name> is a variable you want to use, to check if it is the name of a function.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!