I want so badly to answer this question fully but I'm on mobile and about to go to work. Here's some bullet points: -Japan is not really a unified entity until rather late in the game (can't remember off the top of my head but in the 600-800 AD range). By contrast, china starts its collective self-identity with the Qin dynasty in the mid-3rd century BC. There is a document written by a Chinese envoy to the province of Wa that describes the proto-Japanese people that's worth reading -Mandate of Heaven vs. divine ancestry: once Japanese society is more uniformly established, their creation myths (found in the kojiki) claim that the line of the imperial family (which remains the oldest unbroken royal family even today, IIRC) are all descended from the sun goddess Amaterasu. Chinese emperors didn't and couldn't claim divine bloodlines, but they did claim divine prerogative. I.e. the Chinese believed that heaven mandated that only good emperors/imperial families could maintain rule, and in a concept of dynastic cycle that said that a moral emperor takes the throne, and his bloodline continues until it falls into decadence, at which time a new moral emperor will step in. Interestingly enough, there have been two peasants who rose to emperor in Chinese history - Liu Bang (emperor Gaozu) and Ming Taizu.
So japan actually had a higher opinion of their royalty than did china, but China's wealth, size, military power, etc, means that the Chinese emperor was objectively more powerful and important.
Again, wish I could write more and better but I'm pressed for time.
EDIT: Thanks for all the input from other Asian scholars out there. Yes, I did mean Ming Taizu, not his son Ming Taizong; yes, I was referring to the Records of the Three Kingdoms (Sanguozhi), and here is the link to the part I was referring to: http://www2.u-netsurf.ne.jp/~kojin/e-wajinden10.html
Also, upon re-reading I noticed OP asked specifically about the Medieval period - OP, if you'd like to define Medieval Period for me, I'd be happy to expand a bit on my answer.
Prince Shoutoku was probably one of the biggest factors in bringing Chinese culture, especially Buddhism, to Japan. In fact if I'm not mistaken, he was the one that sent a message to China which essentially said something along the lines of "To the Emperor of the setting sun from your brother the Emperor of the Rising Sun," or something along those lines. This implied that at that time, the Japanese viewed their Emperor as being on par with the Chinese Emperor.
During the Ashikaga Shogunate (1336 - 1573), starting with Ashikaga Yoshimitsu and going until around the fall of the Ashikaga (known as the Muromachi Period of Japan).. the Shoguns claimed that the Emperor of China was their Emperor, and Ashikaga Yoshimitsu would purposefully wear Chinese clothing worn in the Chinese court, began to bring over Chinese customs, and even began to use the Chinese calendar. Ashikaga Yoshimitsu even went so far as to build the Golden Pavilion in the Chinese style.
There were many reasons he did this, one was most definitely trade, the other was to show his disdain for the courts, who under the first Ashikaga shogun, Takauji, had split due to other issues and had split into the Northern Court and the Southern Court.
If it weren't for the trade with China and the taking on of some of their customs and culture, Japan would have never gained the tea ceremony (made popular and ritualized by Ashikaga Yoshimasa), or many of the major Buddhist temples like the Silver and Golden Pavilion that were built during the Ashikaga period, with a Chinese style of architecture.
Donald Keene, Yoshimasa and the Silver Pavilion
Karl Friday, Japan Emerging: Premodern History to 1850