Quantization Error Matlab
Contents |
Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software Product Updates Documentation Home Fixed-Point Designer Examples Functions and Other Reference Release Notes plot quantization error matlab PDF Documentation Fixed-Point Design for MATLAB Code Fixed-Point Functions Math Statistics Fixed-Point Designer matlab code for quantization of sine wave Functions errmean On this page Syntax Description Examples See Also errmeanMean of quantization error Syntaxm = errmean(q)
Descriptionm = errmean(q)
Quantization Error Using Matlab
returns the mean of a uniformly distributed random quantization error that arises from quantizing a signal by quantizer object q. Note The results are not exact when the signal precision is close
Matlab Quantizer
to the precision of the quantizer.ExamplesFind m, the mean of the quantization error for quantizer q:q = quantizer; m = errmean(q) m = -1.525878906250000e-005 Now compare m to m_est, the sample mean from a Monte Carlo experiment:r = realmax(q); u = 2*r*rand(1000,1)-r; % Original signal y = quantize(q,u); % Quantized signal e = y - u; % Error m_est = mean(e) % Estimate of the quantization in matlab code error mean m_est = -1.519507450175317e-005See Alsoerrpdf | errvar | quantize Was this topic helpful? × Select Your Country Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: . You can also select a location from the following list: Americas Canada (English) United States (English) Europe Belgium (English) Denmark (English) Deutschland (Deutsch) España (Español) Finland (English) France (Français) Ireland (English) Italia (Italiano) Luxembourg (English) Netherlands (English) Norway (English) Österreich (Deutsch) Portugal (English) Sweden (English) Switzerland Deutsch Français United Kingdom (English) Asia Pacific Australia (English) India (English) New Zealand (English) 中国 (简体中文) 日本 (日本語) 한국 (한국어) See all countries Trial Software Product Updates Fixed-Point Designer Documentation Examples Functions and Other Reference Release Notes PDF Documentation Other Documentation MATLABSimulinkSymbolic Math ToolboxDSP System ToolboxCommunications System ToolboxDocumentation Home Support MATLAB AnswersInstallation HelpBug ReportsProduct RequirementsSoftware Downloads Try MATLAB, Simulink, and Other Products Get trial now Explore Products MATLAB Simulink Student Software Hardware Support File Exchange Try or Buy Downloads Trial Software Contact Sales Pricing and Licensing Learn to Use Documentation Tutorials Examples Videos and Webinars Training Get Support Installation Help Answers Con
Search All Support Resources Support Documentation MathWorks Search MathWorks.com MathWorks Documentation Support Documentation Toggle navigation Trial Software
Quantization Error Formula
Product Updates Documentation Home Fixed-Point Designer Examples Functions and Other sqnr Reference Release Notes PDF Documentation Fixed-Point Design for MATLAB Code Fixed-Point Functions Math Statistics Fixed-Point Designer quantization noise Functions errpdf On this page Syntax Description Examples Compute the PDF of the quantization error See Also errpdfProbability density function of quantization errorcollapse all in https://www.mathworks.com/help/fixedpoint/ref/errmean.html page Syntax[f,x] = errpdf(q)
f = errpdf(q,x)
Description[f,x] = errpdf(q) returns the probability density function f evaluated at the values in x. The vector x contains the uniformly distributed random quantization errors that arise from quantizing a signal by quantizer object q. f = errpdf(q,x) returns the probability density function f evaluated at the http://www.mathworks.com/help/fixedpoint/ref/errpdf.html values in vector x. Note The results are not exact when the signal precision is close to the precision of the quantizer.Examplescollapse allCompute the PDF of the quantization errorOpen Script q = quantizer('nearest',[4 3]); [f,x] = errpdf(q); subplot(211) plot(x,f) title('Computed PDF of the quantization error.') The output plot shows the probability density function of the quantization error. Compare this result to a plot of the sample probability density function from a Monte Carlo experiment: r = realmax(q); u = 2*r*rand(10000,1)-r; % Original signal y = quantize(q,u); % Quantized signal e = y - u; % Error subplot(212) hist(e,20) gca.xlim = [min(x) max(x)]; title('Estimate of the PDF of the quantization error.') See Alsoerrmean | errvar | quantize × MATLAB Command You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands. Close Was this topic h
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us http://stackoverflow.com/questions/27233011/calculate-quantization-error-in-matlab Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community https://www.youtube.com/watch?v=RxHNQLLsnVc Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Calculate Quantization error in MATLAB up vote 1 down vote favorite iI was given this solution to a problem in my course material. Problem: a signal x(t) sampled at 10 sample/sec. consider the first 10 samples of x(t) x(t) = 0.3 cos(2*pi*t); using quantization error a 8-bit quantiser find the quantisation error. solution: (256 quantisation levels) t=1:10; x=(0.3)*cos(2*pi*(t-1)/10); mx=max(abs(x)); q256=mx*(1/128)*floor(128*(x/mx)); stem(q256) e256=(1/10)*sum(abs(x-q256)) Error: e256 = 9.3750e-04 There was no explanation on this, can you explain how this was calculated in detail? matlab signal-processing pcm quantization share|improve this question edited Dec 1 '14 at 18:28 Rashid 3,6991940 asked Dec 1 '14 at 16:41 connor991 42214 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted For the first two code lines I prefer, Fs = 10; quantization error matlab L = 10; t = (0 : L - 1) / Fs; x = 0.3 * cos(2 * pi * t); where Fs is sampling frequency, L number of samples and t shows the time. Note that x is sinusoidal with frequency of Fx = 1 Hz or we can say that it's periodic with Tx = 1 sec. For 8-bit quantization we have 256 levels. Since L / Fs = [10 sample] / [10 sample/sec] = 1 sec is equal to Tx (a whole period of x) we can work with positive samples. mx = max(abs(x)); mx is defined because in order to use floor we need to scale the x. q256 = mx*(1/128)*floor(128*(x/mx)); mx shows the maximum value for x so x / mx will take values over [-1 1] and 128*x/mx over [-128 128] will cover all 256 levels. So we will quantize it with floor and scale it back (mx*1/128). e256 = (1/L)*sum(abs(x-q256)) e256 simply shows the mean error over 10 samples. Note that if L / Fs < Tx then this quantization won't be the optimum one. Have in mind The answer that you are given has some problems! suppose x = [-1 -.2 0 .7 1]; and we want to quantize it with 2 bits. mx = max(abs(x)); q4 = mx * (1/2) * floor(2*(x/mx)); Will give q4 = [-1 -0.5 0 0.5 1] which has 5 levels (instead of 2^2 = 4). It might not be a big problem, you can delete the level x=1
Επιλέξτε τη γλώσσα σας. Κλείσιμο Μάθετε περισσότερα View this message in English Το YouTube εμφανίζεται στα Ελληνικά. Μπορείτε να αλλάξετε αυτή την προτίμηση παρακάτω. Learn more You're viewing YouTube in Greek. You can change this preference below. Κλείσιμο Ναι, θέλω να τη κρατήσω Αναίρεση Κλείσιμο Αυτό το βίντεο δεν είναι διαθέσιμο. Ουρά παρακολούθησηςΟυράΟυρά παρακολούθησηςΟυρά Κατάργηση όλωνΑποσύνδεση Φόρτωση... Ουρά παρακολούθησης Ουρά __count__/__total__ Analysis of Quantization Error Barry Van Veen ΕγγραφήΕγγραφήκατεΚατάργηση εγγραφής10.60110 χιλ. Φόρτωση... Φόρτωση... Σε λειτουργία... Προσθήκη σε... Θέλετε να το δείτε ξανά αργότερα; Συνδεθείτε για να προσθέσετε το βίντεο σε playlist. Σύνδεση Κοινή χρήση Περισσότερα Αναφορά Θέλετε να αναφέρετε το βίντεο; Συνδεθείτε για να αναφέρετε ακατάλληλο περιεχόμενο. Σύνδεση Μεταγραφή Στατιστικά στοιχεία 9.159 προβολές 45 Σας αρέσει αυτό το βίντεο; Συνδεθείτε για να μετρήσει η άποψή σας. Σύνδεση 46 1 Δεν σας αρέσει αυτό το βίντεο; Συνδεθείτε για να μετρήσει η άποψή σας. Σύνδεση 2 Φόρτωση... Φόρτωση... Μεταγραφή Δεν ήταν δυνατή η φόρτωση της διαδραστικής μεταγραφής. Φόρτωση... Φόρτωση... Η δυνατότητα αξιολόγησης είναι διαθέσιμη όταν το βίντεο είναι ενοικιασμένο. Αυτή