{"id":3087,"date":"2012-01-06T09:40:41","date_gmt":"2012-01-06T14:40:41","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=3087"},"modified":"2018-05-25T15:38:51","modified_gmt":"2018-05-25T19:38:51","slug":"watch-hdtv-in-matlab","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2012\/01\/06\/watch-hdtv-in-matlab\/","title":{"rendered":"Watch HDTV in MATLAB"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29096\">Idin<\/a>'s Pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32651-atsc--from-rf-to-video\">ATSC: From RF to Video,<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/4156\">Dick Benson<\/a>.\r\n   <\/p>\r\n   <p>Watch HDTV in MATLAB? Well, not quite.  This submission shows how to receive ATSC signals (standard used for HDTV in North\r\n      America) using MATLAB\/Simulink, but it&#8217;s not real-time. Nonetheless, this is one of the most complete examples of a communication\r\n      system available on MATLAB Central as it contains every aspect of the receiver from RF to the final video stream. It shows\r\n      how a standards document comes to life, following a top-down design approach (see the ReadMe file).\r\n   <\/p>\r\n   <p>The files in this submission show an ATSC receiver that can demodulate, decode, and display a captured off-the-air TV signal.\r\n      The data file containing the captured signal is provided separately <a href=\"https:\/\/www.mathworks.com\/supportfiles\/spc\/ATSC\/ATSC_Data.zip\">here<\/a> (1.8 GB). The data file contains a 20-second signal from a weather broadcast on WCBV in the Boston area.\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/VideoWCBV1.png\"> <\/p>\r\n   <p>The final model for processing captured signals is shown below:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/SimulinkFinalModel1.png\"> <\/p>\r\n   <p>The raw captured data is passed through two other models to do timing\/carrier synchronization and equalization before it is\r\n      passed to this model. This model contains the symbol processing that follows all front-end processing (it does demodulation,\r\n      decoding, and MPEG-2 file creation). The final result is an MPEG-2 video transport stream (.ts) file that can be played using\r\n      Windows Media Player (or any other MPEG-2 player).\r\n   <\/p>\r\n   <p>The ReadMe file contains detailed description of the algorithms used in each model along with references. It serves as a nice\r\n      tutorial for using Simulink as well as designing digital receivers (not just ATSC).\r\n   <\/p>\r\n   <p>Overall, this is a great submission that can be used as a guide in designing any digital receiver in Simulink. It covers every\r\n      aspect of the problem from capturing off-the-air signals to synchronization and debugging of the models. For more basic tutorials\r\n      and examples on using Simulink for communication system design, see the demos in the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/comm\/comm_product_page.html\">Communications System Toolbox<\/a> (or the Communications Blockset in R2010b and older versions).\r\n   <\/p>\r\n   <p><b>Brief ATSC Standard Background<\/b><\/p>\r\n   <p><a href=\"http:\/\/en.wikipedia.org\/wiki\/ATSC_standards\">ATSC<\/a> standards for digital video transmission were developed in the 1990s by American Television Systems Committee. ATSC was adopted\r\n      by the FCC in the US in mid-90s; however, the switch to digital did not occur until 2009. In June 2009, television broadcast\r\n      in the US converted from analog NTSC to digital ATSC (more commonly referred to as &#8220;digital TV&#8221; or &#8220;HDTV&#8221;). Canada switched\r\n      in August 2011, with Mexico to follow in 2015. ATSC uses 8-VSB modulation over the air, protected by Reed-Solomon error-correction\r\n      coding. The video stream is encoded using MPEG-2 specifications, and Dolby Digital&#8217;s AC-3 audio codec is used for audio encoding.\r\n   <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=3087#respond\">Let us know what you think<\/a>, or leave a comment for Dick <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32651-atsc--from-rf-to-video#comments\">here<\/a>!\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_ce190790839f4b589e44b0b93dfb1ad2() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='ce190790839f4b589e44b0b93dfb1ad2 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' ce190790839f4b589e44b0b93dfb1ad2';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2012 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_ce190790839f4b589e44b0b93dfb1ad2()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p>\r\n<\/div>\r\n<!--\r\nce190790839f4b589e44b0b93dfb1ad2 ##### SOURCE BEGIN #####\r\n%% Watch HDTV in MATLAB\r\n%% \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29096 Idin>'s Pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32651-atsc--from-rf-to-video ATSC: From RF to Video,> by \r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/4156 Dick Benson>.\r\n\r\n%%\r\n% Watch HDTV in MATLAB? Well, not quite.  This submission\r\n% shows how to receive ATSC signals (standard used for HDTV\r\n% in North America) using MATLAB\/Simulink, but it\u00e2\u20ac&#x2122;s not\r\n% real-time. Nonetheless, this is one of the most complete\r\n% examples of a communication system available on MATLAB\r\n% Central as it contains every aspect of the receiver from\r\n% RF to the final video stream. It shows how a standards\r\n% document comes to life, following a top-down design\r\n% approach (see the ReadMe file).\r\n\r\n%%\r\n% The files in this submission show an ATSC receiver that\r\n% can demodulate, decode, and display a captured off-the-air\r\n% TV signal. The data file containing the captured signal is\r\n% provided separately <https:\/\/www.mathworks.com\/support.htmlfiles\/spc\/ATSC\/ATSC_Data.zip here> (1.8 GB).\r\n% The data file contains a 20-second signal from a\r\n% weather broadcast on WCBV in the Boston area.\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/files\/VideoWCBV1.png>>\r\n% \r\n\r\n%%\r\n% The final model for processing captured signals is shown below:\r\n\r\n%%\r\n% \r\n% <<https:\/\/blogs.mathworks.com\/pick\/files\/SimulinkFinalModel1.png>>\r\n% \r\n\r\n%%\r\n% The raw captured data is passed through two other models\r\n% to do timing\/carrier synchronization and equalization\r\n% before it is passed to this model. This model contains the\r\n% symbol processing that follows all front-end processing\r\n% (it does demodulation, decoding, and MPEG-2 file\r\n% creation). The final result is an MPEG-2 video transport\r\n% stream (.ts) file that can be played using Windows Media\r\n% Player (or any other MPEG-2 player).\r\n\r\n%% \r\n% The ReadMe file contains detailed description of the\r\n% algorithms used in each model along with references. It\r\n% serves as a nice tutorial for using Simulink as well as\r\n% designing digital receivers (not just ATSC).\r\n\r\n%%\r\n% Overall, this\r\n% is a great submission that can be used as a guide in\r\n% designing any digital receiver in Simulink. It covers\r\n% every aspect of the problem from capturing off-the-air\r\n% signals to synchronization and debugging of the models.\r\n% For more basic tutorials and examples on using Simulink\r\n% for communication system design, see the demos in the\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2012a\/toolbox\/comm\/comm_product_page.html Communications System Toolbox> \r\n% (or the Communications Blockset\r\n% in R2010b and older versions).\r\n\r\n%%\r\n% *Brief ATSC Standard Background*\r\n% \r\n% <http:\/\/en.wikipedia.org\/wiki\/ATSC_standards ATSC>\r\n% standards for digital video transmission were developed in\r\n% the 1990s by American Television Systems Committee. ATSC\r\n% was adopted by the FCC in the US in mid-90s; however, the\r\n% switch to digital did not occur until 2009. In June 2009,\r\n% television broadcast in the US converted from analog NTSC\r\n% to digital ATSC (more commonly referred to as \u00e2\u20ac\u0153digital TV\u00e2\u20ac\ufffd\r\n% or \u00e2\u20ac\u0153HDTV\u00e2\u20ac\ufffd). Canada switched in August 2011, with Mexico to\r\n% follow in 2015. ATSC uses 8-VSB modulation over the air,\r\n% protected by Reed-Solomon error-correction coding. The\r\n% video stream is encoded using MPEG-2 specifications, and\r\n% Dolby Digital\u00e2\u20ac&#x2122;s AC-3 audio codec is used for audio\r\n% encoding.\r\n\r\n%% \r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=3087#respond Let us know what you think>, or leave a\r\n% comment for Dick\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/32651-atsc--from-rf-to-video#comments here>!\r\n\r\n##### SOURCE END ##### ce190790839f4b589e44b0b93dfb1ad2\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   \r\n   Idin's Pick this week is ATSC: From RF to Video, by Dick Benson.\r\n   \r\n   Watch HDTV in MATLAB? Well, not quite.  This submission shows how to receive ATSC signals (standard used for HDTV... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2012\/01\/06\/watch-hdtv-in-matlab\/\">read more >><\/a><\/p>","protected":false},"author":36,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3087"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=3087"}],"version-history":[{"count":28,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3087\/revisions"}],"predecessor-version":[{"id":9785,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/3087\/revisions\/9785"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=3087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=3087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=3087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}